- From: Kriegesmann, Peter <Peter.Kriegesmann@softwareag.com>
- Date: Mon, 25 Mar 2002 16:49:26 +0100
- To: xmlschema-dev@w3.org
Good afternoon ladies and gentlemen,
I have a question about constraints on model group schema components,
especially Unique Particle Attribution.
See http://www.w3.org/TR/xmlschema-1/#coss-modelGroup
Schema Component Constraint: Unique Particle Attribution
My question:
Is the following schema below valid or is it a violation of the Unique
Particle Attribution ? What is your opinion ?
In my opinion the schema is correct, because within the sequence of the
content model of element "child" only element references are used.
So in fact there is no "ambiguity". This would be the case if there is
either a mix of an element reference and local element definition having the
same name attribute or if 2 local elements having the same name attribute
were defined.
<xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema">
<xs:element name = "root">
<xs:complexType>
<xs:sequence>
<xs:element ref = "child"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name = "child">
<xs:complexType>
<xs:sequence>
<xs:element ref = "x" minOccurs = "0"></xs:element>
<xs:element ref = "x" minOccurs = "0"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name = "x" type = "xs:string"></xs:element>
</xs:schema>
Please do not make any schema optimization suggestions :-)
Of course I know that this schema construct is not very useful and that I
could have used maxOccurs="2".
My question is more a general one.
Best regards,
Peter
Peter Kriegesmann
Phone 06151-921484
Electronic Business Technologies (QE) Fax
06151-921612
Software AG
http://www.softwareag.com
Uhlandstrasse 12
D-64297 Darmstadt
mailto:Peter.Kriegesmann@softwareag.com
Received on Monday, 25 March 2002 10:49:30 UTC