How to create a pattern for a scale in a xsd?
Hello!I need create a pattern in for an string element in an xsd.
It should describe a scale for an image.
I think it needs to support values like
1:1
1:123
123:1
etc.
My idea is to do it like this but I do not know the syntax for the pattern that should restrict this.
I'm really bad at reg exp. so I hope for some help here.
<xs:simpleType name="ScaleType">
<xs:restriction base="xs:string">
<xs:pattern value="\S.{4-DIGITS}:\S.{4-DIGITS}">
</xs:restriction>
</xs:simpleType>
The part \S.{4-DIGITS}:\S.{4-DIGITS} is where I do think I do not get it right. It should support.
The ideal would be if it could support either:
\S.{1-DIGITS}:\S.{4-DIGITS} like 1:1234
or
\S.{4-DIGITS}:\S.{1-DIGITS} like 1234:1
Any ideas is most welcome.
Best regards
Fredrik