I am having a hard time figuring out just what needs to be done in an XML schema document to allow for a recursive structure that I need to use. I need to build tree components from XML that looks like this:
<trees>
<tree name="treeA">
<node name="name1" icon="icon.jpg">
<node name="name2" icon="icon.jpg">
<foo name="foo1" width="100"/>
<foo name="foo2" width="100"/>
<foo name="foo3" width="100"/>
<node name="name3" icon="icon.jpg"/>
</node>
</node>
</tree>
<tree name="treeB">
...
</tree>
</trees>
The XML file can contain descriptions of many trees, a tree has nodes, nodes can have nodes and/or foos, and all nodes and foos have attributes. I have found a few examples of recursive xsd code by searching, but they don't seem to validate.
Any help would be appreaciated.
Thanks in advance.
<trees>
<tree name="treeA">
<node name="name1" icon="icon.jpg">
<node name="name2" icon="icon.jpg">
<foo name="foo1" width="100"/>
<foo name="foo2" width="100"/>
<foo name="foo3" width="100"/>
<node name="name3" icon="icon.jpg"/>
</node>
</node>
</tree>
<tree name="treeB">
...
</tree>
</trees>
The XML file can contain descriptions of many trees, a tree has nodes, nodes can have nodes and/or foos, and all nodes and foos have attributes. I have found a few examples of recursive xsd code by searching, but they don't seem to validate.
Any help would be appreaciated.
Thanks in advance.