views:

27

answers:

1

For this xml:

<elem1 xmlns="http://www.fixprotocol.org/ns/fast/t/1.0"&gt;
 <elem2>
   <elem2/>
 </elem2>
</elem1>

I have this schema, which seems to validate fine against w3 schema validation service, and the schema validates the above XML just fine. Sadly, xsd.exe and some other tools report it to be an error. Is that correct? Are circular group refs dissallowed by XML schema? Thanks!

Update: The schema is not mine, can't change it :(

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.fixprotocol.org/ns/fast/t/1.0" xmlns:t="http://www.fixprotocol.org/ns/fast/t/1.0"&gt;

  <xs:element name="elem1">
    <xs:complexType>
      <xs:group ref="t:grp1" />
   </xs:complexType>
  </xs:element>

  <xs:group name="grp1">
    <xs:sequence>
      <xs:group ref="t:grp2" />
    </xs:sequence>
  </xs:group>

  <xs:group name="grp2">
    <xs:sequence>
      <xs:element minOccurs="0" name="elem2">
        <xs:complexType>
          <xs:group ref="t:grp1" />
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>

</xs:schema>