Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Particle restriction validity (elements with substitution group affiliation)

From: "Michael Kay" <mike@--------.--->
To: "'Bharath Kumar Reddy T'" <bharathkr@------.--->, <xmlschema-dev@--.--->, "'George Cristian Bina'" <george@---------.--->
Date: 1/29/2009 11:17:00 AM
The definition of "substitution group" is already recursive.
 
Michael Kay


  _____  

From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...] On
Behalf Of Bharath Kumar Reddy T
Sent: 29 January 2009 11:03
To: xmlschema-dev@w...; 'George Cristian Bina'
Cc: ashutosh_p@h...; ranjit@h...
Subject: Particle restriction validity (elements with substitution group
affiliation)


Hi..
 
According to the constraints for restriction of a type definition, in the
specification http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict, it is
given that 
 
2.1 Any top-level element declaration particle (in R or B) which is the
<http://www.w3.org/TR/xmlschema-1/#class_exemplar> {substitution group
affiliation} of one or more other element declarations and whose
<http://www.w3.org/TR/xmlschema-1/#key-eq> .substitution group. contains at
least one element declaration other than itself is treated as if it were a
choice group whose  <http://www.w3.org/TR/xmlschema-1/#p-min_occurs> {min
occurs} and  <http://www.w3.org/TR/xmlschema-1/#p-max_occurs> {max occurs}
are those of the particle, and whose
<http://www.w3.org/TR/xmlschema-1/#particles> {particles} consists of one
particle with  <http://www.w3.org/TR/xmlschema-1/#p-min_occurs> {min occurs}
and  <http://www.w3.org/TR/xmlschema-1/#p-max_occurs> {max occurs} of 1 for
each of the declarations in its  <http://www.w3.org/TR/xmlschema-1/#key-eq>
.substitution group..
 
 
so, In the following schema, "d" of base is a choice of "d" and "c". and "C"
of derived is a choice of c and b. 
 
 
 
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:element name="a" type="xs:anyType" substitutionGroup="b"/>
 <xs:element name="b" type="xs:anyType" substitutionGroup="c"/>
 <xs:element name="c" type="xs:anyType" block="substitution"
substitutionGroup="d"/>
 <xs:element name="d" type="xs:anyType"/>

 <xs:complexType name="base">
  <xs:sequence>
   <xs:element ref="d"/>
  </xs:sequence>
 </xs:complexType>

 <xs:complexType name="derived">
  <xs:complexContent>
   <xs:restriction base="base">
    <xs:sequence>
     <xs:choice>
      <xs:element ref="c"/>
     </xs:choice>
    </xs:sequence>
   </xs:restriction>
  </xs:complexContent>
 </xs:complexType>
 <xs:element name="doc" type="base"/>
</xs:schema>

 
 
My doubt: d --- choice of d and c.
                      should i take the above c as a choice of b and c again
recursively???
 
But spec. says that the top level element declaration (in R or B) only can
be considered as choice group. 
So, recursion will not be applied since C  is not referenced again in base
type.
 
 
Can you please tell me whether i should take the choice group recursively or
not???
 
 
Thanks and Regards,
Bharath.
 






 



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent