- From: John Cowan <cowan@ccil.org>
- Date: Sat, 30 Dec 2006 17:42:39 -0500
- To: Syd Bauman <Syd_Bauman@Brown.edu>
- Cc: public-schemata-users@w3.org
Syd Bauman scripsit:
> Now, can anyone verify my belief that a Relax NG validator should
> require that the content of <duck> match *both* pattern R1 *and*
> pattern R2 given the following schema?
>
> datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
> start =
> element test {
> element duck {
> xsd:token {
> pattern = "R1"
> pattern = "R2"
> }
> }+
> }
Easily. See the non-normative, but widely accepted,
"Guidelines for using W3C XML Schema Datatypes with RELAX NG" at
http://relaxng.org/xsd-20010907.html . Section 2 says (in part):
# If the pattern parameter is specified more than once for a single
# data element, then a string matches the data element only if it
# matches all of the patterns. It is an error to specify a parameter
# other than pattern more than once for a single data element.
The point is, of course, that the union of two patterns can be
easily expressed in RELAX NG using a choice, whereas the intersection
of two patterns cannot, since RELAX NG has no general intersection
operator.
--
LEAR: Dost thou call me fool, boy? John Cowan
FOOL: All thy other titles http://www.ccil.org/~cowan
thou hast given away: cowan@ccil.org
That thou wast born with.
Received on Saturday, 30 December 2006 22:42:46 UTC