<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>14398</bug_id>
          
          <creation_ts>2011-10-06 14:10:24 +0000</creation_ts>
          <short_desc>[QT3TS] RE: FOTS Test Suite - Bug fixes to test cases in test-set fn-matches.re</short_desc>
          <delta_ts>2012-05-31 12:23:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 3 &amp; XPath 3 Test Suite</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="O&apos;Neil Delpratt">oneil</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>jim.melton</cc>
    
    <cc>mike</cc>
    
    <cc>tim</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>57904</commentid>
    <comment_count>0</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2011-10-06 14:10:24 +0000</bug_when>
    <thetext>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(&apos;&apos;, &apos;^(?:\n\na\n\nb\n\n)$&apos;) 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57905</commentid>
    <comment_count>1</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2011-10-06 14:17:26 +0000</bug_when>
    <thetext>Correction:

re00130a - Introduced test case which is the same as re00130. Differences: See
re00127a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60346</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2011-11-22 13:41:49 +0000</bug_when>
    <thetext>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:

&lt;test&gt;matches(&apos;a&amp;#xD;&amp;#xA;b&apos;, &apos;^(?:a\r\nb)$&apos;), matches(&apos;ab&apos;, &apos;^(?:a\r\nb)$&apos;)&lt;/test&gt;

as

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

which is then further normalized according to

&quot;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.&quot;

to give

matches(&apos;a { the one-character sequence #xA }
b&apos;, &apos;^(?:a\r\nb)$&apos;), matches(&apos;ab&apos;, &apos;^(?:a\r\nb)$&apos;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60402</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-11-23 20:10:27 +0000</bug_when>
    <thetext>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=&quot;&apos;&amp;#xd;&quot;

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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60405</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-11-23 21:33:28 +0000</bug_when>
    <thetext>I have raised bug #14917 against the XPath specification.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60437</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-11-24 12:13:29 +0000</bug_when>
    <thetext>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).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60491</commentid>
    <comment_count>6</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2011-11-25 14:19:47 +0000</bug_when>
    <thetext>I think test re00130 still contains an error.  Shouldn&apos;t the remaining &amp;#xD; in this be replaced with $d?

      &lt;test&gt;
        let $d := codepoints-to-string(13) return (
         (every $s in tokenize(&apos;&amp;#xA;&apos;||$d||&apos;a&amp;#xA;&amp;#xD;b&apos;, &apos;,&apos;) satisfies (matches($s, &apos;^(?:\n\ra\n\rb)$&apos;))) and
         (every $s in tokenize(&apos;&apos;, &apos;,&apos;) satisfies not(matches($s, &apos;^(?:\n\ra\n\rb)$&apos;))))&lt;/test&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68000</commentid>
    <comment_count>7</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2012-05-22 09:12:00 +0000</bug_when>
    <thetext>Agreed. Fix applied to test re00130</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68407</commentid>
    <comment_count>8</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-05-31 12:23:47 +0000</bug_when>
    <thetext>Confirmed fixed.  Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>