Schema for IPv4: valid or not?

C

Christian Reiser

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,153
Latest member
NamKaufman
Top