|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
XSD question: using multiple restriction patterns
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: Code:
<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>
Looking forward to receivign your comments. Regards,Mos |
|
#2
|
|||
|
|||
|
Oh well, sometimes it can be so easy...It seems that this will do the trick:
Code:
<xs:simpleType name="myElement_Type">
<xs:restriction base="xs:string">
<xs:pattern value="\w\w\w\w"/>
<xs:pattern value="\w\d\w\d"/>
</xs:restriction>
</xs:simpleType>
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Test question: Design patterns & Environments | todavidc-temp | Java | 4 | 10-11-2005 05:48 PM |
| Display one record at a time! | ASP learner | ASP.NET | 5 | 10-08-2002 08:17 PM |
| Multiple Parent/Single Child UML Modeling Question | Kevin | Architecture and Design | 1 | 06-07-2002 01:48 PM |
| question about xsd schema | ec | XML | 2 | 01-31-2002 03:24 PM |
| XSD question | Dave Kraft | XML | 0 | 01-10-2002 10:08 AM |