Jump to content

Circular References Inside a Schema


dornad

Recommended Posts

Hi,I need help with a XMLBeans based App that I'm developing for a client. My client right now stores his info in someXML's which he currently uses in a .NET based App :<company>

<division>

<manager/>

<email/>

<subdivisions>

<division>

...

</division>

<division>

...

</division>

</subdivisions>

</division>

<division>

...

</division>

...

</company>I'm trying to create a XSD for that structure, however I'm stuck with the division reference inside the subdivisions. Is there any way to support this "circular" reference in XSD ?

Link to comment
Share on other sites

Yes. Define the contents of the devision element separately and in the subdevision element, allow only:

<xs:element ref="devision" minOccurs="1" maxOccurs="unbounded"/>

In other words, you'll be defining an element that calls itself.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...