Jump to content
dornad

Circular References Inside a Schema

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 ?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...