Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > <xs:restriction base="xs:integer">

Reply
Thread Tools

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

 
 
Vijay
Guest
Posts: n/a
 
      02-01-2005
<xs:element name="product">
<xs:complexType>
<xs:complexContent>
<xs:restriction base="xs:integer">
<xs:attribute name="prodid" type="xsositiveInteger"/>
</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?

 
Reply With Quote
 
 
 
 
Priscilla Walmsley
Guest
Posts: n/a
 
      02-01-2005
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="xsositiveInteger"/>
</xs:extension>
</xs:simpleContent>
</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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57