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

Defining attributes for elements of native types using Schema

From: Shirish Kulkarni <shirish_kul@yahoo.com>
Date: Sun, 2 Mar 2003 20:53:27 -0800 (PST)
Message-ID: <20030303045327.89373.qmail@web41111.mail.yahoo.com>
To: xmlschema-dev@w3.org

Hi, 

I have a very simple problem - "To define attributes
for an element of which content type is one of the
native ones defined as type="xsd:string" "

<xsd:element name="MY_ELEMENT" type="xsd:string"/>

I already tried the following, but does not seem to
work ( refer at the end of the mail ) 

Any inputs will be welcome -

Thanks, 
Shirish

<xsd:element name="MY_ELEMENT" type="xsd:string">
  <xsd:attribute name="type" type="xsd:string"
use="required"/>
</xsd:element>

OR 
<xsd:element name="MY_ELEMENT" type="String">
  <xsd:attribute name="type" type="xsd:string"
use="required"/>
</xsd:element>

 <xsd:simpleType name="String">
  <xsd:restriction base="xsd:string">  
   <xsd:maxLength value="32"/>
  </xsd:restriction>
 </xsd:simpleType>

XML - 
<MY_ELEMENT type="int">actual_value</MY_ELEMENT>

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
Received on Sunday, 2 March 2003 23:54:37 GMT

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