
April 21st, 2008, 05:36 AM
|
|
Registered User
|
|
Join Date: Apr 2008
Posts: 1
Time spent in forums: 6 m 51 sec
Reputation Power: 0
|
|
|
Extending unordered sequences/choices?
I'm trying to figure out extension and I've got a problem - I'm not sure whether it's my error, a failing of XML Schema, or a failure of the validator tool (http://tools.decisionsoft.com/schemaValidate/)
Basically I have:
Code:
<xs:complexType name="Row">
<xs:sequence maxOccurs="unbounded">
<xs:element name="row" type="Row" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="content" type="Content" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="label" type="Label" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
so an unordered, unbounded set of row, content and labels.
Then I have:
Code:
<xs:complexType name="RepeatingRow">
<xs:complexContent>
<xs:extension base="Row">
<xs:sequence maxOccurs="unbounded">
<xs:element name="row-break" type="RowBreak" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
so an extension of row, but adding a new row-break element.
The trouble is that the aggregate list of RepeatingRow is now partially ordered, i.e. row-break has to go at the end.
Is there any neat way to solve this, without having to duplicate all the code from Row in RepeatingRow?
Thanks,
Rob
|