Question

i"m trying to validate if an xml element is a multiply of 5 by using xsd. does any 1 have an idea how to do it ?

Thanks,

Itay

Was it helpful?

Solution

I'm pretty sure you can't use general formula for validation. But in your specific case you can use a pattern match to match multiples of 5

<xs:element name="myelement">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:pattern value="[0-9]*[05]{1}"></xs:pattern>
    </xs:restriction>
  </xs:simpleType>
</xs:element>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top