Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Adding an attribute to a simple type? [Thread Next] Re: Adding an attribute to a simple type?To: NULL Date: 9/1/2004 6:12:00 PM iT_Ti wrote: > I'm trying to do something in an XSD that I think should be possible, > but that isn't. Giving a simple element an attribute. > > Basically what I tried is this (fragment): > > <xs:element name="DataType"> > <xs:simpleType> > <xs:restriction base="xs:string"> > <xs:enumeration value="int8"/> > <xs:enumeration value="int16"/> > </xs:restriction> > </xs:simpleType> > <xs:attribute name="IsArray" type="xs:string"/> > </xs:element> > > This is not a valid item (attribute not expected) and I don't see why. > It seems a logical way of saying this but it is not valid. If you want to have an attribute on an element then it is a complex type, that is the way W3C XML schema defines it so you need a complex type for that element, there is no way to have "a simple type with an attribute". -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
