[oXygen-user] wrong conjunction for multiple pattern facets?

Syd Bauman
Thu Dec 28 18:50:27 CST 2006


Hi George; thanks for the quick and insightful reply. I just don't
get it, though. Before I explain, though, let me say that I realize
that the rest of this discussion may be out of scope for this list --
this is a problem that is not oXygen's fault, and exists whether or
not oXygen does. I get to this problem because I use oXygen, but feel
free to tell me it's time to move this to rng-users or some such.


I am close the furthest thing there is from an expert on the W3C XML
Schema language, and I had never heard of, let alone read, 4.3.4.3,
before you pointed it out. But upon reading it now, I have to admit I
don't quite understand
a) what it means
b) what it's got to do with RelaxNG validation


The text of 4.3.4.3 says something that, on the face of it, seems
silly. 

   If multiple <pattern> element information items appear as
   [children] of a <simpleType>, the [value]s should be combined as
   if they appeared in a single regular expression as separate
   branches.

First, I am under the (perhaps erroneous) impression that a <pattern>
element can not be the child of a <simpleType> element.

Second, the idea seems silly. If I wanted two regular expressions R1
and R2 to appear in a single regular expression as separate branches,
I could have just written "R1|R2", no? So my gut instinct is that
this rule isn't helpful.

The note attached to 4.3.4.3 says

   ... pattern facets specified on the same step in a type derivation
   are ORed together, while pattern facets specified on different
   steps of a type derivation are ANDed together.

but I have yet to figure out what a "step" is. Sigh. I suppose I
should probably just go buy & read Eric van der Vlist's book on XSD
and read it ... maybe someday.


But more importantly, whatever XSD says about multiple patterns,
RelaxNG seems pretty clear. The following is from section 2 of
"Guidelines for using W3C XML Schema Datatypes with RELAX NG"[1]

   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. 

Seems pretty clear to me.


Note
----
[1] Which I found at http://relaxng.org/xsd-20010907.html; it is
    linked to from the main RelaxNG home page.




More information about the oXygen-user mailing list