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

George Cristian Bina
Fri Dec 29 02:22:28 CST 2006


Hi Syd,

Thanks for following on this issue.
Here it is what happened: one of our users reported this as a bug. 
Asserting this as a bug was based on the fact that if you convert the 
Relax NG schema to XML Schema through TRANG you will get multiple 
pattern facets in XML Schema that as I quoted the spec will be ORed, so 
the result XML Schema will accept a value that matches any of the 
pattern constraints and I thought Relax NG just delegates to XML Schema 
for these facet constraints so it should behave similarly.
I can very easily rollback those changes in oNVDL - in fact I will 
provide you a link to an updated version with these changes rolled back 
soon.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Syd Bauman wrote:
> 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.
> 
> _______________________________________________
> oXygen-user mailing list
> 
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user




More information about the oXygen-user mailing list