W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2015

[Bug 29310] New: [FO31] Invalid and ambiguous XPath expression in normative part of section 5.4.3 fn:substring

From: <bugzilla@jessica.w3.org>
Date: Sat, 28 Nov 2015 08:17:13 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29310-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29310

            Bug ID: 29310
           Summary: [FO31] Invalid and ambiguous XPath expression in
                    normative part of section 5.4.3 fn:substring
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.1
          Assignee: mike@saxonica.com
          Reporter: abel.braaksma@xs4all.nl
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

Under 5.4.3 fn:substring we write:

<quote>
More specifically, the three argument version of the function returns the
characters in $sourceString whose position $p satisfies:

fn:round($start) <= $p < fn:round($start) + fn:round($length)
</quote>

But this is an illegal XPath expression. If it isn't meant to be an XPath
expression, I thing the text should say so, but even then, the associativity is
ambiguous. One might read this as:

(fn:round($start) <= $p) < (fn:round($start) + fn:round($length))

or as:

fn:round($start) <= ($p < fn:round($start)) + fn:round($length)

But neither expressions make much sense in light of the text. Perhaps the
following was meant (in which case parentheses are no longer necessary)?

fn:round($start) <= $p and $p < fn:round($start) + fn:round($length)

Alternatively, we might consider using the same approach as for fn:subsequence,
which has a clearer way of defining in a proper XPath what the function is
supposed to return.

-------

Note that there are other places where ambiguous associativity is used, for
instance '1<=N<=S" in fn:replace and "-π/2 <= θ <= +π/2" in math:asin, but in
these case the textual context makes it clear that these are not meant to be
read as XPath expressions, moreover, the mathematical meaning of "between" is
easily deducted from the text.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Saturday, 28 November 2015 08:17:16 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 28 November 2015 08:17:17 UTC