[
Lists Home |
Date Index |
Thread Index
]
Hmm. XercesJ reports three errors (not warnings) from this schema of the
form:
Error - src-resolve: Cannot resolve the name 'unknownX' to a(n) 'type
definition' component.
Where X is one of: 1, 2, 3;
Bob Foster
Henry S. Thompson wrote:
> 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
|