Schema for IPv4: valid or not?

Discussion in 'XML' started by Christian Reiser, Aug 13, 2004.

  1. Hi,

    i have two schema validators:
    http://tools.decisionsoft.com/cgi-bin/schemaValidate.cgi
    http://apps.gotdotnet.com/xmltools/xsdvalidator/Default.aspx

    And an snippet from my schema:
    <xsd:simpleType name="ipv4">
    <xsd:restriction base="xsd:token">
    <xsd:pattern
    value="((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9]))"/>
    </xsd:restriction>
    </xsd:simpleType>


    My xml:
    <loopback> 10.0.0.1 </loopback>

    I expect this to be valid... decisionsoft.com thinks so to -
    gotdotnet.com disagrees. I would like to have a valid schema also with
    leading and trailing spaces/tabs. I know, that by using token as
    restriction-base also "10.1. 12.34" is valid - is there a better way?

    Ciao
    Christian
     
    Christian Reiser, Aug 13, 2004
    #1
    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. Ben
    Replies:
    0
    Views:
    568
  2. Markus
    Replies:
    1
    Views:
    1,580
    Markus
    Nov 23, 2005
  3. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,277
    Stanimir Stamenkov
    Apr 25, 2005
  4. qazmlp

    code for validating IPv4 address

    qazmlp, Jul 27, 2003, in forum: C Programming
    Replies:
    14
    Views:
    1,007
    Default User
    Jul 29, 2003
  5. tweak
    Replies:
    14
    Views:
    2,792
    Eric Sosman
    Jun 11, 2004
Loading...

Share This Page