Re: Query on element ref attribute in Schema Standards

> In the above schema file global element “comment” having 
> the child which referring to itself…If Schema standards
> allow this type of definition it is impossible to validate the document…
> I have checked this schema with standard editors like 
> Altova xml spy editor and styllus tool…They showed this
> schema as valid schema definition but they
> are not able to generate valid xml document according to this Schema
> According to this schema. I have checked in the w3c 
> standards also, I didn’t find any restriction in the standards on 
> This type of definitions….

Yes, XML permits the definition of unsatisfiable content models...there 
are a number of different cases of this (e.g., a simple type that 
restricts integer and has a pattern facet of "[a-z]+").

You can easily turn this into a satisfiable content model by making the 
recursive comment optional, etc.

   <element name="comment">
      <complexType>
         <sequence>
            <element ref="ipo:comment" minOccurs="0" maxOccurs="1"/>
         </sequence>
      </complexType>
   </element>

pvb

Received on Wednesday, 8 March 2006 17:20:50 UTC