[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
xsd self reference

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

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.