I have an XML file which I want to generate a schema for. The file, simplified, looks like this:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<nodes>
<node>
<node></node>
<node>
<node></node>
</node>
<text></text>
</node>
</nodes>
The <node> elements can hold an infinite number of other <node> elements.
Now I auto generated the schema from VS2005 and get:
Code:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="nodes">
<xs:complexType>
<xs:sequence>
<xs:element name="node">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="node">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="node" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="text" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
I cannot work out how to modify the schema to tell it about the <node> once and make it understand that <node> can nest other <node>'s.
Any ideas?