W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2009

RE: Restricting attribute use from optional to required

From: Michael Kay <mike@saxonica.com>
Date: Fri, 28 Aug 2009 10:05:16 +0100
To: 'Jan Přidal' <jan.pridal@gmail.com>, <xmlschema-dev@w3.org>
Message-ID: <734EEFFA17E64F8484E6BE434333DC5D@Sealion>
> So basically you're telling me that I don't have to repeat 
> all attributes from attributeGroup in restriction and it is 
> sufficient to just list the changed ones, that is the 'label' 
> attribute in my case?
> 
> <xsd:complexType name="parentWithReqLabelAttr">  <xsd:complexContent>
>    <xsd:restriction base="parent">
>      <xsd:group ref="commonElements"/>
>      <xsd:attribute name="label" type="xsd:string" use="required"/>
>      <!-- no need to list all remaining attributes from 
> 'attributes' group -->
>    </xsd:restriction>
>  </xsd:complexContent>
> </xsd:complexType>
> 

Correct.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 
Received on Friday, 28 August 2009 09:06:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:14 GMT