W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2001

How to define an element with attribute

From: Wang K H <khong.hai.wang@gridnode.com>
Date: Fri, 30 Mar 2001 13:47:23 +0800
Message-ID: <001b01c0b8dc$e521fe20$b9d5a8c0@gridnode.com>
To: <xmlschema-dev@w3.org>
Hi all,

I am new to schema and is trying to write a schema. Please refer to the example below :
<Value POSITION="4">PART</Value>

How do I define the schema for the above element?

Right now, I am writing as :

<xsd:element name="Value" minOccurs="0" maxOccurs="unbounded">

<xsd:complexType>



<xsd:attribute name="POSITION" type="xsd:positiveInteger" use="optional"/>

</xsd:complexType>

</xsd:element>



In the above, I miss out the type for the element value. How or where can I specify it? If none is specified, what will the default type be?

Thanks in advance for any help.
Received on Friday, 30 March 2001 00:48:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:20 GMT