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 30385 - [XP31] StringConcatExpr doesn't clearly define error conditions or its mapping to fn:concat
Summary: [XP31] StringConcatExpr doesn't clearly define error conditions or its mappin...
Status: NEW
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 3.1 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-25 14:59 UTC by Abel Braaksma
Modified: 2018-12-25 14:59 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2018-12-25 14:59:46 UTC
The text under "3.6 String Concatenation Expressions" states:

"String concatenation expressions allow the string representations of values to be concatenated. In XPath 3.1, $a || $b is equivalent to fn:concat($a, $b)."

In similar cases where we refer to a certain function in F&O from XPath we usually do two things:

* Link to that function, to ensure it is clear the F&O 3.1 version is meant
* Add a sentence something like "the same error conditions as for fn:concat" apply to this expression

Also, we don't explain in depth how a StringConcatExpr is translated to an fn:concat function, but I guess this leads little wiggle room in interpretation anyway.

I noticed that "||" is left-associative, and that "," (for function arguments) is marked as "neither associative". This may lead to evaluation-order differences in rare cases, if "||" gets directly translated to fn:concat (though I don't have an example of this, I just noticed the difference).

In the section "A.4 Precedence Order (Non-Normative)", it says that for "neither" the associativity is inconsequential, but for "||" is is.

Perhaps the proper way of interpreting this text is to see chained "||" as nested fn:concat#2 calls to ensure its left-associativity.