Bug 15594 - [FO30] fn-matches-45
Summary: [FO30] fn-matches-45
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.0 (show other bugs)
Version: Member-only Editors Drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-17 13:35 UTC by Tim Mills
Modified: 2012-03-28 11:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Mills 2012-01-17 13:35:27 UTC
This test expects true.  However, in http://www.w3.org/TR/xmlschema-2/#nt-WildcardEsc the wildcard "." is listed as being equivalent to [^\n\r].  The comment in this test seems to directly contradict this.  Compare with fn-matches-43.
 
   <test-case name="fn-matches-45">
      <description> "." does match CR in default mode</description>
      <created by="Michael Kay" on="2012-01-13"/>
      <test>fn:matches(concat('Mary', codepoints-to-string(13), 'Jones'), 'Mary.Jones')</test>
      <result>
         <assert-true/>
      </result>
   </test-case>
Comment 1 Michael Kay 2012-01-17 14:03:41 UTC
The test is to highlight that (for reasons unknown to me) the XPath definition here is different from the XSD definition.

5.6.1.1 says: If the s flag is not specified, the meta-character . matches any character except a newline (#x0A) character.

We can pursue this as a spec bug if you wish. One could argue that it contradicts the statement in 5.6:

"The regular expression syntax and semantics are identical to those defined in [XML Schema Part 2: Datatypes Second Edition] with the following additions:"

and that 5.6.1.1 is not trying (or should not try) to be normative about what happens in the absence of any flags.
Comment 2 Tim Mills 2012-01-17 14:19:01 UTC
As suggeseted, I've changed this bug report to be against the 3.0 specification.
Comment 3 Michael Kay 2012-03-20 18:28:20 UTC
The WG decided to solicit information on how existing implementations (including XQuery 1.0 implementations) handle this test case before making a decision.
Comment 4 Michael Kay 2012-03-27 15:57:43 UTC
The WG agreed to align the spec with XSD: that is, "." matches everything except CR and NL. This change will be made for 3.0. The question of an erratum for the XPath 2.0 version of the spec remains open; we will add this to the informal list of candidate errata being maintained by the editor.
Comment 5 Michael Kay 2012-03-28 11:03:20 UTC
The 3.0 spec has been updated to reflect this change; a note has been added to the list of candidate errata for 1.0/2.0. The test case fn-matches-45 has been updated to reflect the resolution. I am therefore marking this bug as closed.