W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2005

Re: Self reference in XML schema?

From: George Cristian Bina <george@oxygenxml.com>
Date: Wed, 12 Jan 2005 09:59:25 +0200
Message-ID: <41E4D8DD.8050705@oxygenxml.com>
To: Yang Feng <yfeng@entry.com>
Cc: xmlschema-dev@w3.org

Hi,

Have a look at the personal.xsd/personal-schema.xml samples from Xerces J.

http://cvs.apache.org/viewcvs.cgi/xml-xerces/java/data/
http://cvs.apache.org/viewcvs.cgi/xml-xerces/java/data/personal.xsd?view=markup
http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-xerces/java/data/personal-schema.xml?content-type=text%2Fplain

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Yang Feng wrote:
> Hi there,
> 
>  
> 
> I am new to XML schema. I wonder if I can use self reference in XML 
> schema. In my XML data, the EMPLOYEE element contains MANAGER element. 
> MANAGER is also an EMPLOYEE. How can I use XML schema to define this 
> relationship without repeating the same code for EMPLOYEE and MANAGER 
> elements?
> 
> Is there any sample code? The XML have the following structure:
> 
>  
> 
> <EMPLOYEE>
> 
>             <ID />
> 
>             <name />
> 
>              <MANAGER>
> 
>                         <ID />
> 
>                         <name />
> 
>             </MANAGER>
> 
> </EMPLOYEE>
> 
>  
> 
> Thanks in advance.
> 
>  
> 
> Yolande
> 
Received on Wednesday, 12 January 2005 07:54:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:49 GMT