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

Re: Defining attributes for elements of native types using Schema

From: Shirish Kulkarni <shirish_kul@yahoo.com>
Date: Sun, 2 Mar 2003 23:32:43 -0800 (PST)
Message-ID: <20030303073243.20735.qmail@web41101.mail.yahoo.com>
To: xmlschema-dev@w3.org

Hi, 

I have got the answer in ( Section 2.5.1 Complex Types
from Simple Types ) 
http://www.w3.org/TR/xmlschema-0/

Thanks,
Shirish


--- Shirish Kulkarni <shirish_kul@yahoo.com> wrote:
> 
> 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/
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
Received on Monday, 3 March 2003 02:50:04 GMT

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