[Bug 6908] Definition of pattern facet

http://www.w3.org/Bugs/Public/show_bug.cgi?id=6908





--- Comment #7 from Dave Peterson <davep@iit.edu>  2009-06-08 17:45:08 ---
(In reply to comment #6)

> I think "each" is supposed to map to "at least one of the members", e.g.

> [Definition:]   pattern is a constraint on the ·value space· of a datatype
> which is achieved by constraining the ·lexical space· to ·literals· which match
> at least one member of a set of regular expressions.

No.  If there are more than one <pattern> elements (each having an RE as
content) in the XML defining a single restriction step, all of those REs will
be "or"ed together to produce a single RE which will be placed in the set of
REs which is the value of the pattern component.  Then if a subsequent
restriction also uses a pattern, the single RE for that step is also placed in
the set of REs for that subsequent restriction's pattern component.

The result of multiple pattern-based derivations is a set of REs, one for each
derivation step.  The final datatype's lexical representations must satisfy the
conditions added at each step, i.e., must satisfy all of the REs in the set.

(In reply to comment #5)
> As I said in comment #2, the problem with "each" or "all members" is that the
> casual reader, who is not necessarily versed in the subtleties of the spec, may
> easily come to the incorrect conclusion that if a schema document defines a
> simple type with multiple xs:pattern elements, then the value has to satisfy
> them all. I wanted to use wording that would lead them to read further before
> leaping to this conclusion.
> 
> Try to put yourself in the position of a reader of the spec. They see a schema
> document with more than one xs:pattern element; they want to know what it
> means; they turn to section 4.3.4 which describes the pattern facet; and the
> first thing they read is that the value must match each pattern in a set of
> patterns (or regular expressions). Are they likely to read any further?

If a reader is looking at an XML derivation representation having one or more
<pattern> elements looks at the definition of the component and doesn't have
sense enough to look at "XML Representation Summary: pattern Element
Information Item", I'm not sure what we can do to help.

You *can't* just say "one or more" in the definition, and then later on say "we
really meant all".  That will invite a whole lot more confusion.

Would a warning in the first paragraph help?

"Note:  An XML <restriction> containing more than one <pattern> elements gives
rise to a single regular expression in the set; this regular expression is an
"or" of the regular expressions that are the content of the <pattern>
elements."


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 8 June 2009 17:45:18 UTC