473,699 Members | 2,311 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<xs:restricti on base="xs:intege r">

<xs:element name="product">
<xs:complexType >
<xs:complexCont ent>
<xs:restricti on base="xs:intege r">
<xs:attribute name="prodid" type="xs:positi veInteger"/>
</xs:restriction>
</xs:complexConte nt>
</xs:complexType>
</xs:element>
In above XSD definition, what is the significance of <xs:restricti on
base="xs:intege r"> . Does it add any value?

Jul 20 '05 #1
1 3940
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:simpleConte nt>
<xs:extension base="xs:intege r">
<xs:attribute name="prodid" type="xs:positi veInteger"/>
</xs:extension>
</xs:simpleConten t>
</xs:complexType>
</xs:element>

Hope that helps,
Priscilla
----------------------------------
Priscilla Walmsley
Author, Definitive XML Schema
http://www.datypic.com
----------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.