dimanche 24 novembre 2019

XSD pattern of a vector of ints separated by a char

I need to restrict this structure:

<IN> 43.3,42.4,42.2,42.0,41.8,41.6,41.2,40.8,40.4,39.8,39.4,38.7,38.0,37.3,36.5,35.7,34.8,33.9,33.0,31.9,30.9,30.0,29.0,27.9, 0.0</IN>

Does someone know the restriction pattern? I need to do something like that, I am not quite sure if its correct.:

<xs:simpleType name="inType">
   <xs:restriction base="xs:string">
       <xs:whiteSpace value="preserve"/>
       <xs:pattern value="[ ]?[1-9]{1}[0-9]*[.]*[0-9]*([,]{1}[ ]?[1-9]{1}[0-9]*[.]*[0-9]*)*(, 0.0){1}"/>
   </xs:restriction>
</xs:simpleType>

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire