W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2002

RE: multiple attributes help.

From: Kriegesmann, Peter <Peter.Kriegesmann@softwareag.com>
Date: Wed, 13 Nov 2002 13:36:16 +0100
Message-ID: <DFF2AC9E3583D511A21F0008C7E62106023724D0@daemsg02.software-ag.de>
To: "'Cyrill Zadra'" <czadra@bluewin.ch>
Cc: "'xmlschema-dev@w3c.org'" <xmlschema-dev@w3c.org>

Hi Reshma,

Several attributes are allowed.

See http://www.w3.org/TR/xmlschema-1/#declare-type

See content model of complexType:

Content: (annotation?, (simpleContent | complexContent | ((group | all |
choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))).

For beginners, the XML Schema Part 0 Primer is always a good starting point:

At the end of the page, there is a list of xml schema elements:

There is one link to an example for each xml schema element and another one
leading to a more detailed description/definition of the element structure
(including allowed attributes, content model and so on).

Personally I also like ZVON's schema browser:

Best regards,

-----Original Message-----
From: Cyrill Zadra [mailto:czadra@bluewin.ch]
Sent: Mittwoch, 13. November 2002 13:11
To: xmlschema-dev@w3c.org
Subject: Re: multiple attributes help.

Hi Reshma,

As far as I know is it possible, but I've not yet a lot of xml-schema 
knowledge now. I would use attributeGroup & refer, when you need the 
same attribute for other elements.


reshma@intelesoftech.com wrote:
> Hello all,
> Is it possible to have multiple attributes for an element as follows.
> <xsd:element name="product" type="ProductType"/>
>   <xsd:complexType name="ProductType">
>     <xsd:sequence>
>       <xsd:element name="number" type="xsd:integer"/>
>       <xsd:element name="size" type="xsd:integer"/>
>     </xsd:sequence>
>     <xsd:attribute name="effDate" type="xsd:date"/>
>     <xsd:attribute name="effTime" type="xsd:time"/>
>   </xsd:complexType>
> </xsd:element>
> Is the above example is right or should I define a attributeGroup & refer 
> it?
Received on Wednesday, 13 November 2002 07:37:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:06 UTC