Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - >Thread Next - RE: Restricting attribute use from optional to required Restricting attribute use from optional to requiredTo: xmlschema-dev@--.--- Date: 8/16/2009 10:34:00 AM Hello all, my question follows, I am using XML Schema 1.0. I have an attributeGroup with an optional attribute. This attributeGroup is used in declaration of complexType. Another complexType is then an extension of that complexType. Please see my sample code below. I would like to declare the attribute 'label' as required for the 'derived' complexType. Is there any legal way to do it? <xsd:attributeGroup name="attributes"> ... <xsd:attribute name="label" type="xsd:string" /> </xsd:attributeGroup> <xsd:complexType name="parent"> <xsd:complexContent> ... <xsd:attributeGroup ref="attributes"/> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="derived"> <xsd:complexContent> <xsd:extension base="parent"> <xsd:sequence> <xsd:element ref="parameter" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required"/> </xsd:extension> </xsd:complexContent> </xsd:complexType> Regards, Jan Pridal | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
