[Home] [By Thread] [By Date] [Recent Entries]


Hi Bob,

Thanks for checking the example below.

I am afraid it was just used by ht to show some concept that I was
pondering and need not actually run to prove the point (it does
though, simply remove the type declaration in the elements x, y, z)

I moved the ensuing discussion to xmlschema-dev@w... by suggestion of ht.

Kind Regards,

Gregor

2005/4/28, Bob Foster <bob@o...>:
> 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
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 
>

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member