![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - NEWBIE: XML restriction query >Thread Next - Re: NEWBIE: XML restriction query Re: NEWBIE: XML restriction queryTo: NULL Date: 2/3/2004 1:16:00 PM Victor wrote: > Hi, I have defined the following that limits values for <COUNTING> to > be ONE, TWO or THREE. I want to modify it so the base isn't a string > anymore but a long, and accept ANY long as valid, but I still want to > accept the values ONE, TWO, or THREE. Can this be done? > You could use a regular expression as the restriction, eg: "ONE|TWO|THREE|[1-9][0-9]+" > Thank you > Victor > > > <xs:simpleType name="COUNTING"> > <xs:restriction base="xs:string"> > <xs:enumeration value="ONE"/> > <xs:enumeration value="TWO"/> > <xs:enumeration value="THREE"/> > </xs:restriction> > </xs:simpleType> > > > > The following would be valid against a new restriction > > ONE > TWO > 17 > 65 > THREE > ONE > 765 > 861 > 12 > 67 > > > > The following would be invalid > ONE > TWO > FOUR > 17 > 65 > THREE > ONE > 765 | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
