<xs:restriction base="xs:integer">

V

Vijay

<xs:element name="product">
<xs:complexType>
<xs:complexContent>
<xs:restriction base="xs:integer">
<xs:attribute name="prodid" type="xs:positiveInteger"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:element>


In above XSD definition, what is the significance of <xs:restriction
base="xs:integer"> . Does it add any value?
 
P

Priscilla Walmsley

That type definition is not valid. You can't restrict the integer type
and try to add attributes at the same time.

I'm not sure what it is trying to accomplish, but if the idea is for the
product element to contain an integer, and also have a prodid attribute
that is a positive integer, it should look like this:

<xs:element name="product">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="prodid" type="xs:positiveInteger"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>

Hope that helps,
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
473,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top