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

Multiple attributes and attributeGroups

From: Bryce K. Nielsen <bryce@sysonyx.com>
Date: Tue, 27 Apr 2004 15:22:58 -0600
Message-ID: <08dd01c42c9d$d3d5fa80$500abed8@PREZ>
To: <xmlschema-dev@w3.org>

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:40:21 UTC

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