W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2004

Re: restriction of subelements

From: gayathri veerarajan <gaytri_v@yahoo.co.in>
Date: Fri, 12 Mar 2004 07:56:14 +0000 (GMT)
Message-ID: <20040312075614.50344.qmail@web8202.mail.in.yahoo.com>
To: "Henry S. Thompson" <ht@inf.ed.ac.uk>
Cc: xmlschema-dev@w3.org
Hi,
   Thanks for your help.
 Is there any way of restricting the subelements of an element type. for example in the complexType SLR, I have an element viewFinder of type Viewer.( Viewer is of complexType with  choice of elements "ThroughTheLens" and  "WindowOnTopOfCamera" ).I want the element viewFinder to contain a subelement "ThroughTheLens"only.
 
<xsd:complexType name="SLR">
  <xsd:complexContent>
    <xsd:restriction base="camera:Camera">
      <xsd:sequence>
         <xsd:element name="lens" type="Lens" minOccurs="0" 
maxOccurs="unbounded"/>
         <xsd:element name="viewFinder" type="Viewer" 
fixed="ThroughTheLens" minOccurs="1"             maxOccurs="1"/>
         <xsd:element name="body" type="Body" minOccurs="0" 
maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:restriction>
  </xsd:complexContent>
</xsd:complexType>

I found that assigning a fixed value to viewFinder as above is not a valid way of doing this.
is there any possibility of doing so?.
I need ur help.
 
Thank u,
V.Gayathri.
 


Yahoo! India Insurance Special: Be informed on the best policies, services, tools and more.
Received on Friday, 12 March 2004 02:59:14 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:40:23 UTC