Re: XML schemas question

From: Ray Denenberg, Library of Congress <rden_at_nyob>
Date: Mon, 27 Jul 2009 11:48:18 -0400
To: CODE4LIB_at_LISTSERV.ND.EDU
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" <rochkind_at_JHU.EDU>
To: <CODE4LIB_at_LISTSERV.ND.EDU>
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 
Received on Mon Jul 27 2009 - 11:48:45 EDT