Connecting Tech Pros Worldwide Forums | Help | Site Map

Restriction on attributes in XSD

vincente13@gmail.com
Guest
 
Posts: n/a
#1: Jun 12 '06
Hi all,

I would like to know if this schema is correct..

.....
.....
<xs:simpleType name="stringtype">
<xs:restriction base="xs:string"/>
</xs:simpleType>

....
....
...
<xs:element name="opsmenu">
....
.....
....
<xs:attribute name="debug" use="optional">
<xs:simpleType>
<xs:restriction base="stringtype">
<xs:pattern value="on|off"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
.....
.....

<opsmenu debug="on"> -->> this is my root element in the xml

debug attribute is either on or off and it is optional...

Is the above declarations correct?
I'm getting this error Found <simpleType> illegally combined with
<complexType>.

Im not sure if the declaration is right or there is a bug in the
parser.

Appreciate any inputs


Priscilla Walmsley
Guest
 
Posts: n/a
#2: Jun 14 '06

re: Restriction on attributes in XSD


Hi,

The code you've posted here looks fine. However, it might be something
in the parts you left out. If you post the whole section of the schema
(at least the entire declaration of opsmenu) we can probably help you
out better.

Priscilla

----------------------------------
Priscilla Walmsley
Author, Definitive XML Schema
XQuery
http://www.datypic.com
----------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Closed Thread