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 29522 - fn:replace() with q flag
Summary: fn:replace() with q flag
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
Reported: 2016-03-09 18:09 UTC by Debbie Lockett
Modified: 2016-03-21 23:01 UTC (History)
1 user (show)

See Also:


Description Debbie Lockett 2016-03-09 18:09:14 UTC
The error conditions under 5.6.3 fn:replace which raise err:FORX0004 should only be raised if the q flag has not been set, so it would be useful to add this condition to the descriptions. Currently these state:

A dynamic error is raised [err:FORX0004] if the value of $replacement contains a "$" character that is not immediately followed by a digit 0-9 and not immediately preceded by a "\".

A dynamic error is raised [err:FORX0004] if the value of $replacement contains a "\" character that is not part of a "\\" pair, unless it is immediately followed by a "$" character.

See the example under the section about the q flag in Flags (which expects some output not an error): 
fn:replace("a/b/c", "/", "$", "q") returns "a$b$c"

[I will add this example (and others) as test cases to the QT3 fn-replace test set in anticipation of this clarification; see fn-replace-49 to 53.]
Comment 1 Andrew Coleman 2016-03-18 14:55:21 UTC
At the meeting on 2016-03-15, the WG agreed to resolve this by clarifying the error conditions do not apply when the ‘q’ flag is not present.
Comment 2 Michael Kay 2016-03-21 18:07:18 UTC
The changes have been applied.