W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2006

Re: Query on element ref attribute in Schema Standards

From: <Paul.V.Biron@kp.org>
Date: Wed, 8 Mar 2006 09:20:07 -0800
To: kishoremv@huawei.com
Cc: www-xml-schema-comments@w3.org, www-xml-schema-comments-request@w3.org
Message-Id: <OFF35F8EFF.809E9FE4-ON8825712B.005E9531-8825712B.005F3A4E@KP.ORG>
> 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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 23 October 2007 06:13:39 GMT