This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14398 - [QT3TS] RE: FOTS Test Suite - Bug fixes to test cases in test-set fn-matches.re
Summary: [QT3TS] RE: FOTS Test Suite - Bug fixes to test cases in test-set fn-matches.re
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Working drafts
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-06 14:10 UTC by O'Neil Delpratt
Modified: 2012-05-31 12:23 UTC (History)
3 users (show)

See Also:


Attachments

Description O'Neil Delpratt 2011-10-06 14:10:24 UTC
I have applied fixes to the following test cases in the test set fn-matches.re (file: matches.re.xml) and introduced new tests:

re00126 - applied fn:not to the first fn:matches (i.e. matches('', '^(?:\n\na\n\nb\n\n)$') is never true).

re00127 - Changed the dependency to XPATH 3.0+. Issues relating to the serialization of escape characters not matching pattern because of parser.

re00127a - Introduced test case which is the same as re00127, but differs in that its dependency is XQuery 3.0+ only and test case is wrapped in a CDATA section.

re00129 - same reasoning as for re00127

re00129a - Introduced test case which is the same as re00129. Differences: See re00127a

re00130 - same reasoning as for re00127

re00130a - Introduced test case which is the same as re00129. Differences: See re00130a
Comment 1 O'Neil Delpratt 2011-10-06 14:17:26 UTC
Correction:

re00130a - Introduced test case which is the same as re00130. Differences: See
re00127a
Comment 2 Tim Mills 2011-11-22 13:41:49 UTC
I think that the tests re00127, re00129 and re00130 are dodgy.

e.g. re00129

When extracted from the test suite XML file, the XML parser will present:

<test>matches('a&#xD;&#xA;b', '^(?:a\r\nb)$'), matches('ab', '^(?:a\r\nb)$')</test>

as

matches('a { the two-character sequence #xD #xA }
b', '^(?:a\r\nb)$'), matches('ab', '^(?:a\r\nb)$')

which is then further normalized according to

"The XPath 3.0 processor must behave as if it normalized all line breaks on input, before parsing. The normalization should be done according to the choice to support either [XML 1.0] or [XML 1.1] lexical processing."

to give

matches('a { the one-character sequence #xA }
b', '^(?:a\r\nb)$'), matches('ab', '^(?:a\r\nb)$')
Comment 3 Michael Kay 2011-11-23 20:10:27 UTC
I had never noticed that XPath 2.0 requires line breaks to be normalized. This is very unfortunate in an XSLT context, where it means that expressions such as 

xsl:value-of select="'&#xd;"

no longer have the expected effect. This is an undocumented incompatibility with XPath 1.0 and XSLT 1.0, and I propose to raise a bug against the spec.
Comment 4 Michael Kay 2011-11-23 21:33:28 UTC
I have raised bug #14917 against the XPath specification.
Comment 5 Michael Kay 2011-11-24 12:13:29 UTC
I have changed the three tests is question so they now work whether or not the XPath processor normalizes line endings. (Getting a x0D into an XPath string required some ingenuity). A test for XPath line endings has been added elsewhere (misc-XMLEdition, for want of a better place).
Comment 6 Tim Mills 2011-11-25 14:19:47 UTC
I think test re00130 still contains an error.  Shouldn't the remaining &#xD; in this be replaced with $d?

      <test>
        let $d := codepoints-to-string(13) return (
         (every $s in tokenize('&#xA;'||$d||'a&#xA;&#xD;b', ',') satisfies (matches($s, '^(?:\n\ra\n\rb)$'))) and
         (every $s in tokenize('', ',') satisfies not(matches($s, '^(?:\n\ra\n\rb)$'))))</test>
Comment 7 O'Neil Delpratt 2012-05-22 09:12:00 UTC
Agreed. Fix applied to test re00130
Comment 8 Tim Mills 2012-05-31 12:23:47 UTC
Confirmed fixed.  Thanks.