See below. You'll need to change attribute types to reflect the values they
can take.
<xs:complexType name="testType">
<xs:attribute name="name" use="required" type="xs:string"/>
<xs:attribute name="spec" use="required" type="xs:string"/>
</xs:complexType>
<xs:complexType name="testGroupType">
<xs:sequence>
<xs:element name="testgroup" type="testGroupType" minOccurs="0"/>
<xs:element name="test" type="testType" minOccurs="0" />
</xs:sequence>
<xs:attribute name ="name" type="xs:string"/>
<xs:attribute name ="result" type="xs:string"/>
</xs:complexType>
<xs:complexType name="aType">
<xs:choice maxOccurs="unbounded">
<xs:element name="testgroup" type="testGroupType"/>
<xs:element name="test" type="testType"/>
</xs:choice>
</xs:complexType>
<xs:element name="a" type="aType"/>
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<ko**************@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
hello,
I need to represent recursive relationship in xml which will be
validated by defined xml schema.
example: check.xml
<a>
<testgroup name="first" result ="pass">
<testgroup name="second">
<test name="OPEN" spec = "0"/>
</testgroup>
<test name="SHORT" spec ="1"/>
</testgroup>
<test name="CLOSE" spec ="1"/>
<testgroup name="third" result ="fail">
<test name="OPEN" spec = "1"/>
</testgroup>
</a>
so i have to write a xml schema which can validate "check.xml"
Thanks in advance.