- From: <bugzilla@jessica.w3.org>
- Date: Mon, 08 Dec 2014 16:14:15 +0000
- To: public-qt-comments@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27536
Bug ID: 27536
Summary: [XP31] Focus for evaluation of keyspecifier in lookup
Product: XPath / XQuery / XSLT
Version: Last Call drafts
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: XPath 3.1
Assignee: jonathan.robie@gmail.com
Reporter: mike@saxonica.com
QA Contact: public-qt-comments@w3.org
Biro D. Botond (botond23@gmail.com) raised the following on public-qt-comments:
Is it expected to evaluate the keyspecifier with a new inner focus?
>From semantic equivalance of E?S and E ! ?S one would expect so – in
this case I suggest to mention the postfix lookup in the context
changing expressions in 2.1.2 Dynamic context – context item
definition.
MHK comment:
It appears that the current specification for the binary lookup operator does
cause S to be evaluated with a focus based on E. It's not clear that this is
what we intended, and it's not clear that it has any benefits. On the contrary,
it seems to bring back some of the known pitfalls of the focus change in
ordinary predicates.
For example, one might expect that
<xsl:for-each select="1 to 5">
<xsl:copy-of select="$array?(.+1)"/>
</xsl:for-each>
does the same as
<xsl:for-each select="1 to 5">
<xsl:copy-of select="$array(.+1)"/>
</xsl:for-each>
but as currently specified, this is not the case; it actually raises a type
error because "." is bound to the array.
Unfortunately, changing this makes it difficult to define binary-? in terms of
unary-?. A better approach might be to define the unary expression ?X as
equivalent to .?X, and to define $A?(E) as equivalent to
for $a in $A, $e in $E return $a($e)
provided that $a is a map or array (else type error).
--
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Monday, 8 December 2014 16:14:20 UTC