Print

Print


Any element that is not a child of another.   Or another way to look at it, 
any element that can be referenced by "ref=".

In the following schema:

______________________________________________
<xs:schema>
<xs:element name="a" type="aType"/>
<xs:element name="b" type="bType"/>
<!-- !-->
<xs:complexType name="aType">
<xs:element ref="a"/>
<xs:element name="c" type="xs:string"/>
</xs:complexType>
<!-- !-->
<xs:complexType name="bType">
<xs:element ref="b"/>
<xs:element name="c" type="xs:string"/>
</xs:complexType>
</xs:schema>
__________________________________________________________

<a>,  and <b> can be roots.  <d> cannot.

--Ray



----- Original Message ----- 
From: "Jonathan Rochkind" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Monday, July 27, 2009 11:35 AM
Subject: [CODE4LIB] XML schemas question


> Anyone familiar with XML schemas (.xsd)?
>
> Can you help me figure something out. Is there something in the schema 
> that specifies what elements can serve as the 'root node'... or is any 
> element described in the schema avaialable for use as a 'root node', and 
> it'll still validate?
>
> Thanks for any tips.
>
> Jonathan