Restriction on attributes in XSD

V

vincente13

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
 
P

Priscilla Walmsley

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top