W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2012

Re: Attribute with fixed value in derived types

From: Michael Kay <mike@saxonica.com>
Date: Wed, 27 Jun 2012 14:44:10 +0100
Message-ID: <4FEB0E2A.9080901@saxonica.com>
To: Florent Georges <lists@fgeorges.org>
CC: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Something like this:

     <xs:complexType name="type">
        ...
        <xs:attribute ref="my:attr" use="required"/>
     </xs:complexType>

     <xs:complexType name="restrictedType">
       ...

       <xs:attribute ref="my:attr" use="required" fixed="...."/>
     </xs:complexType>
  
    I then use it to define some elements with additional children:

     <xs:element name="elem">
        <xs:complexType>
       <xs:complexContent>
          <xs:extension base="my:restrictedType">
         <xs:sequence>
            ...
         </xs:sequence>
          </xs:extension>
       </xs:complexContent>
        </xs:complexType>
     </xs:element>

Michael Kay
Saxonica
Received on Wednesday, 27 June 2012 13:44:37 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:20 UTC