Hi again. I have nearly completed the schema but cannot seem to be rid of this one error.
I originally thought it was because I had used xs:import for two GML schemas, with both under the same namespace and I found out that is not allowed. I therefore created a new schema and used xs:include in order to include both of those schemas and then in my main application schema I could then use a single xs:import for that namespace. (Beats me why they haven't already created one all-mighty xsd for this purpose..but anyway.)
I am receiving the following error:
E [Xerces] src-element.2.2: Since 'gml:Point' contains the 'ref' attribute, its content must match (annotation?). However, 'complexType' was found.
Here is the xml extract (which is based on the hierarchy already shown previously):
Code:
<geo:location>
<gml:Point gml:id="slopePeak">
<gml:pos>316865 504940</gml:pos>
<geo:lat>54.432893</geo:lat>
<geo:long>-3.283085</geo:long>
</gml:Point>
</geo:location>
Here is the schema extract:
Code:
<xs:element name="location" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element ref="gml:Point">
<xs:complexType>
<xs:sequence>
<xs:element ref="gml:pos" />
<xs:element name="lat" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="long" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:attribute name="gml:id" type="xs:token"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
The external schema file that I created in order to contain the required schema files I need but in one, has these three inclusions:
Code:
<include schemaLocation="gmlBase.xsd"/>
<include schemaLocation="geometryBasic0d1d.xsd"/>
<include schemaLocation="basicTypes.xsd"/>
This file is then referenced successfully in to my application schema.
I think that gml:Point comes is defined in that middle file and looks like this:
Code:
<element name="Point" type="gml:PointType" substitutionGroup="gml:_GeometricPrimitive"/>
<!-- ============================================================== -->
<complexType name="PointType">
<annotation>
<documentation>A Point is defined by a single coordinate tuple.</documentation>
</annotation>
<complexContent>
<extension base="gml:AbstractGeometricPrimitiveType">
<sequence>
<choice>
<annotation>
<documentation>GML supports two different ways to specify the direct poisiton of a point. 1.
The "pos" element is of type DirectPositionType.
</documentation>
</annotation>
<element ref="gml:pos"/>
</choice>
</sequence>
</extension>
</complexContent>
</complexType>
The error (it seems) therefore has a problem with how I've used the gml:Point element, however I have used it as per the book I have on gml and it seemingly should work according to the above definition. Though their schema is somewhat more complex that I am comfortable reading!
Hopefully someone can pinpoint my error - it's probably a simple one knowing me! Thanks