moschen
10-13-2009, 08:46 AM
Hi,
I would like the content of an element to match one of two possible string patterns. How can I implement this?
Goal:
<myElement>abcd</myElement>
or
<myElement>a1b2</myElement>
Something like:
<xs:simpleType name="myElement_Type">
<xs:restriction base="xs:string">
<xs:choice>
<xs:pattern value="\w\w\w\w"/>
<xs:pattern value="\w\d\w\d"/>
</xs:choice>
</xs:restriction>
</xs:simpleType>
Please note, that the example is a huge simplification. In reality the pattern for each of the choices is a lot more complex.
Looking forward to receivign your comments.
Regards,Mos
I would like the content of an element to match one of two possible string patterns. How can I implement this?
Goal:
<myElement>abcd</myElement>
or
<myElement>a1b2</myElement>
Something like:
<xs:simpleType name="myElement_Type">
<xs:restriction base="xs:string">
<xs:choice>
<xs:pattern value="\w\w\w\w"/>
<xs:pattern value="\w\d\w\d"/>
</xs:choice>
</xs:restriction>
</xs:simpleType>
Please note, that the example is a huge simplification. In reality the pattern for each of the choices is a lot more complex.
Looking forward to receivign your comments.
Regards,Mos