saxon 9 sa warning on schema unique constraint

R

RolfK

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
 
M

Martin Honnen

RolfK said:
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 ?

I could not find a problem with the schema snippets you posted. You
might want to check with a different validating parser like Xerces. If
Xerces or another validating parser does not find an issue then I would
raise the problem on the Saxon help list.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top