deriving restriction types -Sorry for the previous message-please read this msg

please dont consider my previous message, it was by mistake i sent it.
sorry for the inconvenience.
please reply to this message.


Yahoo! India Matrimony: Find your partner online.
I would like to know whether this is a valid restriction

<xsd:complexType name="WineGrape">
 <xsd:choice>
  <xsd:element ref="WineGrape" minOccurs="0" maxOccurs="unbounded" /> 
  <xsd:element ref="CabernetFrancGrape" minOccurs="0" 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:choice>
</xsd:complexType>

I want to derive a new complex type restricted from wineGrape where I expect the element  CabernetFrancGrape to appear atleast once.

so I tried deriving as follows ,but it gave me an error.

<xsd:complexType name="WineGrape_hasValue_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>
</xsd:complexType>

Is this because of the sequence construct in place of choice.
If I give choice then only the element CabernetFrancGrape would appear each time when this type is referenced(because its minoccurs is 1). Is my assumption correct?

and also I dont think that sequence construct in place of choice is a problem, because the code mentioned below  got validated

<xsd:complexType name="WineGrape_ZinfandelGrape">
- <xsd:complexContent>
- <xsd:restriction base="vin:WineGrape">
- <xsd:sequence>
  <xsd:element ref="ZinfandelGrape" /> 
  </xsd:sequence>
  </xsd:restriction>
  </xsd:complexContent>
  </xsd:complexType>

please suggest how to do this.

regards,
V.gayathri.   

Received on Thursday, 8 April 2004 09:03:17 UTC