views:

32

answers:

0

Hey they, I am currently working on a application dealing with a XML file. The XML file looks like this :

<config>
 <ip>10.10.100.2</ip>
 <subnet>255.255.0.0</subnet>
 <gateway>10.10.1.1</gateway>
</config>

Now I am on validation. I use XSD. So my validation works fine with the IP element and Subnet Element. I done something like this for the IP element:

<xs:pattern value="((((25[0-5])|(2[0-4][0-9])|([01]?[0-9]?[0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|([01]?[0-9]?[0-9])))(\-((((25[0-5])|(2[0-4][0-9])|([01]?[0-9]?[0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|([01]?[0-9]?[0-9]))))?"/>

With the subnet I got my problems so I decided to give all possible values into the XSD :

<xs:restriction base="xs:string">
 <xs:enumeration value="128.0.0.0"/>
 <xs:enumeration value="192.0.0.0"/>

But now I am trying to validate the Gateway. I know that it is possible with XSLT (at least I hope so) but I dont know how and I dont want to implement the validation into the appliocation itself.

If someone can help me, I would be very happy :D

Thanks again.