[
Lists Home |
Date Index |
Thread Index
]
I'll answer a simple question which I understand, and which I _think_
is what you're asking.
The following XML document is valid:
<!DOCTYPE root [
<!ELEMENT root (a|x)>
<!ELEMENT a (b|y)>
<!ELEMENT b (c|z)>
<!ELEMENT c EMPTY>
]>
<root><a><b><c/></b></a></root>
Note it contains no declarations for the elements x, y and z.
The corresponding schema document successfully validates the same
instance:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="root">
<xs:complexType>
<xs:choice>
<xs:element ref="a"/>
<xs:element ref="x"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="a">
<xs:complexType>
<xs:choice>
<xs:element ref="b"/>
<xs:element ref="y"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="b">
<xs:complexType>
<xs:choice>
<xs:element ref="c"/>
<xs:element ref="z"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="c">
<xs:complexType/>
</xs:element>
<xs:element name="x" type="unknown1"/>
<xs:element name="y" type="unknown2"/>
<xs:element name="z" type="unknown3"/>
</xs:schema>
So yes, you can do incremental development of a schema for a complex
XML language.
ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
|