Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - A simple newbie question [Thread Next] Re: A simple newbie questionTo: NULL Date: 1/4/2006 2:25:00 PM You must first create a simple type which represents the restricted simple
content:
<xs:simpleType name="mySimpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="none" />
<xs:enumeration value="hidden" />
<xs:enumeration value="top" />
<xs:enumeration value="bottom" />
</xs:restriction>
</xs:simpleType>
then you should create and complex type and extend that simple content and
add an attribute:
<xs:complexType name="type_errors">
<xs:simpleContent>
<xs:extension base="mySimpleType">
<xs:attribute name="stack" type="type__on_off" use="optional"
default="off" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:schema>
Thanks.
"Lüpher Cypher" <lupher.cypher@v...> wrote in message
news:im3uf.3254$tJ1.916@trndny01...
> Hi,
> I need to define an element which can take on predefined values and has
> an optional attribute.
>
> <xs:simpleType name="type__on_off">
> <xs:restriction base="xs:token">
> <xs:enumeration value="on" />
> <xs:enumeration value="off" />
> </xs:restriction>
> </xs:simpleType>
>
> <xs:complexType name="type_errors">
> <xs:simpleContent>
> <xs:restriction base="xs:token">
> <xs:enumeration value="none" />
> <xs:enumeration value="hidden" />
> <xs:enumeration value="top" />
> <xs:enumeration value="bottom" />
> <xs:attribute name="stack" type="type__on_off"
> use="optional" default="off" />
> </xs:restriction>
> </xs:simpleContent>
> </xs:complexType>
>
> This gives me a validation error "XMLSchema:string is used as a base for
> complex type restriction".
>
> What am I doing wrong?
>
> Thanks!
>
>
> --
>
> - lüpher
> ---------------------------------------------
> "Man sieht nur das, was man weiß" (Goethe)
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
