Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Designing a recursive XML schema

From: "Susan Harris" <susanbharris1972@-----.--->
To: NULL
Date: 9/16/2008 8:38:00 PM

I'm looking to define a particular kind of recursive XML Schema. It needs to 
describe the following kind of document:

<nodes>
  <node>
    <name>Node 1</name>
    <item/>
  </node>
  <node>
    <name>Node 2</name>
    <nodes>
      <node>
        <item/>
        <name>Node 4</name>
      </node>
    </nodes>
  </node>
  <node>
    <name>Node 3</name>
    <item/>
  </node>
</nodes>

Key features of this document are:

1) nodes/node nesting can be to any (reasonable) depth.
2) All "node" elements must contain "a name elements " AND ("a nodes 
elements " OR "an item elements "). Or, to put it another way, it should not 
contain both a "node" and "item", but must have one of them - in addtion to 
the name element, which it also must have.
3). "name" elements can come before or after the "nodes" or "item" element 
(e.g. be in an xs:all compositor.

Where I'm really struggling is in how to get the name and nodes OR items. 
Looks like I need an xs:all with an xs:choice underneath it, but that 
doesn't seem to be allowed.

Help? 



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent