chiropterist / kml-samples

Automatically exported from code.google.com/p/kml-samples
0 stars 0 forks source link

Google samples with LookAt tags violate XmlSchemaConstraints requirement #289

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Which products are affected?

Google Earth

What steps will reproduce the problem?

1. Browse to http://www.kmlvalidator.com/home.htm
2. Validate any of the following KML samples to KML Schema 2.2

http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/LineString/absolute-ex
truded.kml
http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/LineString/extruded.km
l
http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/LineString/straight.km
l
http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/LineString/styled.kml
http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/LineString/tessellate.
kml
http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/Point/altitude.kml
http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/Point/extruded.kml
http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/styled_placemark.kml
http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/styled_placemark2.kml

3. Each report following XML Schema constraint violation
relating to this OGC KML requirement:  XmlSchemaConstraints

cvc-complex-type.2.4.a: Invalid content was found starting with element 'tilt'.
 One of '{"http://www.opengis.net/kml/2.2":altitudeModeGroup,
    "http://www.opengis.net/kml/2.2":LookAtSimpleExtensionGroup,
    "http://www.opengis.net/kml/2.2":LookAtObjectExtensionGroup}'
   is expected.

What is the expected output or behavior? What do you see instead?

Expect each of the Google samples to be valid KML with respect to the
defined KML XML
specification in this case KML 2.2 http://www.opengis.net/kml/2.2.

Each of these KML documehts validate against KML 2.1 spec but have been
simply renamed to the KML 2.2 namespace http://www.opengis.net/kml/2.2
without having the element order changed to reflect changes in the
underlying schemas.

In this case KML 2.1 defined the LookAtType with the *all* tag allowing
no restriction on element order within LookAt, however, KML 2.2 defined
a strict sequence with order of elements different than defined in KML 2.1.

KML 2.1:

<complexType name="LookAtType" ...>
    <complexContent>
      <extension base="kml:ObjectType">
        <all>
          <element name="longitude“
                                    type="kml:angle180"
                                    minOccurs="0" default="0"/>
          <element name="latitude"  type="kml:angle90"
                                    minOccurs="0" default="0"/>
          <element name="altitude"  type="double"
                                    minOccurs="0" default="0"/>
          <element name="range"  type="double“
                                    minOccurs="0"/>
          <element name="tilt“
                                    type="kml:anglepos90"
                                    minOccurs="0" default="0"/>
          <element name="heading“
                                    type="kml:angle360"
                                    minOccurs="0" default="0"/>
          …
        </all>
      </extension>
    </complexContent>
  </complexType>

KML 2.2:

  <complexType name="LookAtType" final="#all">
    <complexContent>
      <extension base="kml:AbstractViewType">
        <sequence>
          <element ref="kml:longitude“ minOccurs="0"/>
          <element ref="kml:latitude" minOccurs="0"/>
          <element ref="kml:altitude" minOccurs="0"/>
          <element ref="kml:heading" minOccurs="0"/>
          <element ref="kml:tilt" minOccurs="0"/>
          <element ref="kml:range" minOccurs="0"/>
    ...
        </sequence>
      </extension>
    </complexContent>
  </complexType>

KML 2.1 reports the order as range, tilt, heading while KML 2.2
reports the order as heading, tilt, and range.

KML 2.1 examples if converted/named as KML 2.2 must be re-ordered to
validate against KML 2.2 schema.

While the examples view correctly in the Google Earth they are nevertheless
not valid KML documents.

What application versions (if any) are you using?

 All.

Which operating systems and browsers are affected?

 All.

Please provide any additional information (code snippets/links) below.

This relates to a bug in Google Earth that takes valid KML 2.2 documents
and saves KML in the tag order as defined by KML 2.1. This creates invalid
KML documents.

http://code.google.com/p/earth-issues/issues/detail?id=359

Original issue reported on code.google.com by gjmath...@gmail.com on 14 Aug 2009 at 1:58

GoogleCodeExporter commented 9 years ago
KML samples still are erroneously marked as using the KML 2.2 namespace. Can be 
fixed by either changing namespace to KML 2.1 or fix order of tags.

Original comment by gjmath...@gmail.com on 15 Jun 2010 at 4:44