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

Re: Multiple attributes and attributeGroups

From: Xan Gregg <xan.gregg@jmp.com>
Date: Tue, 27 Apr 2004 17:54:22 -0400
Message-Id: <71645E17-9895-11D8-812F-000393BB384C@jmp.com>
Cc: <xmlschema-dev@w3.org>
To: "Bryce K. Nielsen" <bryce@sysonyx.com>

Yes, the {attribute uses} property of the Complex Type Definition 
component is defined as a union of the uses from all attribute and 
attributeGroup child elements (and any uses from the base type in case 
of derivation by extension).  And the XML representation allows 
attribute and attributeGroup child elements to be mixed freely.

xan

On Apr 27, 2004, at 5:22 PM, Bryce K. Nielsen wrote:
> In a complexType, can you have multiple declarations of attributes 
> and/or
> attributeGroups? For example, is this schema valid:
>
> <?xml version="1.0" encoding="utf-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">
>   <xsd:element name="Author">
>     <xsd:complexType>
>       <xsd:sequence>
>         <!-- some elements -->
>       </xsd:sequence>
>       <xsd:attributeGroup ref="Id"/>
>       <xsd:attribute name="website" type="xsd:string"/>
>       <xsd:attributeGroup ref="Genre"/>
>       <xsd:attribute name="Living" type="xsd:boolean"/>
>     </xsd:complexType>
>   </xsd:element>
>   <xsd:attributeGroup name="Id">
>     <xsd:attribute name="Name" type="xsd:string"/>
>     <xsd:attribute name="Num" type="xsd:integer"/>
>   </xsd:attributeGroup>
>   <xsd:attributeGroup name="Genre">
>     <xsd:attribute name="Preferred" type="xsd:string"/>
>     <xsd:attribute name="Secondary" type="xsd:string"/>
>   </xsd:attributeGroup>
> </xsd:schema>
>
> -BKN
>
Received on Tuesday, 27 April 2004 17:57:48 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:11 UTC