Dear ALL,
I'm creating a schema and have a behaviour I do not understand. Basically I have declared all my elements as global complex types and refere to them later in complex types.
Please see some code snipets:
<xs:element name="MPTest"> <==== This is the top element <xs:complexType> <xs:sequence> <xs:element ref="Preamble"/> <xs:element ref="SpecItems"/> <xs:element ref="ConditionSets"/> .......
<xs:element name="SpecItems">
<xs:complexType>
<xs:sequence>
<xs:element ref="SpecItem" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:unique name="SpecItemName"> <==== Line 219 is here <xs:selector xpath="SpecItem"/> <xs:field xpath="@Name"/> </xs:unique> </xs:element>
....
<xs:element name="SpecItem">
<xs:complexType>
<xs:sequence>
<xs:element ref="Description"/>
<xs:element ref="sdoc:SimpleDoc"/>
<xs:element ref="Measurement" maxOccurs="6"/>
</xs:sequence>
<xs:attribute name="Name" type="tGeneralName" use="required"/> <xs:attribute name="Drift" type="tGeneralName" use="optional"/>
......
In case I do not use the xs:unique cinstarint every thing is validated OK BUT, in case I have it in I get this warning:
...sourcing Saxon 9.1.0.1 and JDK 1.5.11
Warning: on line 219 of MarginTable.xsd:
The complex type of element SpecItems does not allow a child element named SpecItem
In my understanding SpecItem is clearly an allowed child of SpeItems. Why does saxon complain by adding the unique constraint ?
Any idea is welcome
Thanks
Rolf
I'm creating a schema and have a behaviour I do not understand. Basically I have declared all my elements as global complex types and refere to them later in complex types.
Please see some code snipets:
<xs:element name="MPTest"> <==== This is the top element <xs:complexType> <xs:sequence> <xs:element ref="Preamble"/> <xs:element ref="SpecItems"/> <xs:element ref="ConditionSets"/> .......
<xs:element name="SpecItems">
<xs:complexType>
<xs:sequence>
<xs:element ref="SpecItem" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:unique name="SpecItemName"> <==== Line 219 is here <xs:selector xpath="SpecItem"/> <xs:field xpath="@Name"/> </xs:unique> </xs:element>
....
<xs:element name="SpecItem">
<xs:complexType>
<xs:sequence>
<xs:element ref="Description"/>
<xs:element ref="sdoc:SimpleDoc"/>
<xs:element ref="Measurement" maxOccurs="6"/>
</xs:sequence>
<xs:attribute name="Name" type="tGeneralName" use="required"/> <xs:attribute name="Drift" type="tGeneralName" use="optional"/>
......
In case I do not use the xs:unique cinstarint every thing is validated OK BUT, in case I have it in I get this warning:
...sourcing Saxon 9.1.0.1 and JDK 1.5.11
Warning: on line 219 of MarginTable.xsd:
The complex type of element SpecItems does not allow a child element named SpecItem
In my understanding SpecItem is clearly an allowed child of SpeItems. Why does saxon complain by adding the unique constraint ?
Any idea is welcome
Thanks
Rolf