RE: multiple attributes help.

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:
http://www.w3.org/TR/xmlschema-0/

At the end of the page, there is a list of xml schema elements:
http://www.w3.org/TR/xmlschema-0/#index

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:
http://www.zvon.org/xxl/xmlSchema2001Reference/Output/Schema/index.html


Best regards,
Peter


-----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.

Cyrill

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