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

Discussion in 'XML' started by Vijay, Feb 1, 2005.

  1. Vijay

    Vijay Guest

    <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?
     
    Vijay, Feb 1, 2005
    #1
    1. Advertising

  2. 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
    ----------------------------------
    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!
     
    Priscilla Walmsley, Feb 1, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RWQ=?=

    file restriction - Forms authentication

    =?Utf-8?B?RWQ=?=, May 31, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    397
    Jim Cheshire [MSFT]
    Jun 1, 2004
  2. =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=

    Scripted Window Restriction?

    =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=, Oct 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    412
    =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=
    Oct 5, 2004
  3. z f
    Replies:
    2
    Views:
    5,138
  4. Manglu
    Replies:
    1
    Views:
    1,020
    Anders =?iso-8859-1?Q?Engstr=F6m?=
    Aug 8, 2003
  5. Olaf

    integer range restriction

    Olaf, Jun 3, 2007, in forum: VHDL
    Replies:
    7
    Views:
    689
    Paul Uiterlinden
    Jun 4, 2007
Loading...

Share This Page