W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2003

Re: combining enumeration and pattern

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 30 Jun 2003 10:15:19 +0100
To: "Simon Cox" <Simon.Cox@csiro.au>
Cc: <xmlschema-dev@w3.org>, "Clemens Portele" <portele@interactive-instruments.de>
Message-ID: <f5bllvk6i54.fsf@erasmus.inf.ed.ac.uk>

"Simon Cox" <Simon.Cox@csiro.au> writes:

> Re: Re-using XSD schema-for-schemasIn simpleType derivation-by restriction,
> is it legal to apply both enumeration and pattern constraints in the same
> derivation step?  The first rule in
> http://www.w3.org/TR/xmlschema-2/#defn-rep-constr appears to allow it, and I
> can't find anything that disallows it.
> In other words, is this valid?
> <simpleType name="DrillCodeType">
>     <restriction base="string">
>       <enumeration value="RAB"/>
>       <enumeration value="RC"/>
>       <enumeration value="DD"/>
>       <enumeration value="DD-HQ"/>
>       <enumeration value="DD-NQ"/>
>       <pattern value="other:\w{2,}"/>
>     </restriction>
>   </simpleType>

Sure, that's OK -- facets are facets, you can use as many or as few as
you like, as long as you don't break the obvious rules (e.g. not both
minInclusive and minExclusive, not min > max).

> If yes, is it still OK if the pattern used for a restiction of simpleContent
> in a complexType definition.

Yes -- same rules in both cases.

  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                      Half-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Monday, 30 June 2003 05:15:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:11 UTC