Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re:deriving restriction types

From: =?iso-8859-1?q?gayathri=20veerarajan?= <gaytri_v@-----.--.-->
To: Xan Gregg <Xan.Gregg@---.--->
Date: 4/10/2004 1:14:00 PM
Thanks for ur reply Sir.I orginally did not mean this way.

<xsd:complexType name="WineGrape">
 <xsd:choice minOccurs="0" maxOccurs="unbounded" > <!--it is just xsd:choice -->
  <xsd:element ref="WineGrape"  /> 
  <xsd:element ref="CabernetFrancGrape"  /> 
  <xsd:element ref="CabernetSauvignonGrape" /> 
  <xsd:element ref="ChardonnayGrape"  /> 
  <xsd:element ref="CheninBlancGrape"  /> 
  <xsd:element ref="ZinfandelGrape"  /> 
  <xsd:element ref="GamayGrape"  /> 
 </xsd:choice>
</xsd:complexType>

it is just <xsd:choice> ,since I would be referencing this type in  two different cases as follows

<xsd:complexType name="Wine">
  <xsd:sequence>
	<xsd:element name="madeFromGrape" type="WineGrape" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>  


<xsd:complexType name="Zinfandel">
  <xsd:sequence>
	<xsd:element name="madeFromGrape" type="WineGrape" minOccurs="0" maxOccurs="1"/>
  </xsd:sequence>
</xsd:complexType>  

since maxOccurs  is set to "1" for the element "madeFromGrape" as above 
When we consider the following Wine type the maxOccurs I prefer to have <xsd:choice> as a generalised one.

 
Now I would like to derive a restricted Wine as folows

<xsd:complexType name="StEmilion">
 <xsd:complexContent>
   <xsd:restriction base="Wine">
     <xsd:sequence>
	<xsd:element name="madeFromGrape" type="CabernetFrancGrape" minOccurs="0" maxOccurs="unbounded"/>
     </xsd:sequence>
   </xsd:restriction>
  </xsd:
  </xsd:complexType>  

and cabernetFrancGrape is derived from WineGrape. my requirement is that the element madeFromGrape should have the subelement CabernetFrancGrape and also have any other elements. 

<xsd:complexType name="CabernetFrancGrape">
- <xsd:complexContent>
-   <xsd:restriction base="vin:WineGrape">
-     <xsd:sequence>
        <xsd:element ref="CabernetFrancGrape" minOccurs="1" maxOccurs="unbounded" /> 
        <xsd:element ref="CabernetSauvignonGrape" minOccurs="0" maxOccurs="unbounded" /> 
        <xsd:element ref="ChardonnayGrape" minOccurs="0" maxOccurs="unbounded" /> 
        <xsd:element ref="CheninBlancGrape" minOccurs="0" maxOccurs="unbounded" /> 
        <xsd:element ref="ZinfandelGrape" minOccurs="0" maxOccurs="unbounded" /> 
        <xsd:element ref="GamayGrape" minOccurs="0" maxOccurs="unbounded" /> 
     </xsd:sequence>
  </xsd:restriction>
 </xsd:complexContent>

but sequence doesn't seem to work. is there any other way of doing this.
I cannot do as u have suggested,since type WineGrape is a general one and each time I have to pose different restriction.
could u suggest me any other way of doing this Sir.

thank u,
V.Gayathri.


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