<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. Advertisements

  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. Advertisements

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?Sm9l?=

    CType(x,Integer) vs. Integer.Parse(x)

    =?Utf-8?B?Sm9l?=, Feb 6, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    6,204
    =?Utf-8?B?RGF2aWQgQW50b24=?=
    Feb 7, 2006
  2. =?ISO-8859-1?Q?Thomas_Gagn=E9?=

    No Math.min(Integer, Integer)?

    =?ISO-8859-1?Q?Thomas_Gagn=E9?=, Jul 29, 2003, in forum: Java
    Replies:
    0
    Views:
    697
    =?ISO-8859-1?Q?Thomas_Gagn=E9?=
    Jul 29, 2003
  3. Sebastian Stelzer

    How do I add an Integer to another Integer?

    Sebastian Stelzer, Oct 14, 2004, in forum: Java
    Replies:
    2
    Views:
    658
    Yu SONG
    Oct 15, 2004
  4. Sebastian Stelzer

    How do I add an Integer to another Integer?

    Sebastian Stelzer, Oct 14, 2004, in forum: Java
    Replies:
    6
    Views:
    48,262
    JavaBean2010
    Apr 7, 2010
  5. Johannes Zellner
    Replies:
    22
    Views:
    4,391
  6. les ander
    Replies:
    4
    Views:
    1,150
    wes weston
    Oct 5, 2004
  7. Replies:
    14
    Views:
    2,539
    CBFalconer
    Jun 18, 2005
  8. Olaf

    integer range restriction

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