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 23644 - [UPD 3.0] Relax update checks and allow last step of path to be updating
Summary: [UPD 3.0] Relax update checks and allow last step of path to be updating
Status: RESOLVED WONTFIX
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update 3.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: John Snelson
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-26 14:47 UTC by Christian Gruen
Modified: 2014-07-30 13:55 UTC (History)
2 users (show)

See Also:


Attachments

Description Christian Gruen 2013-10-26 14:47:03 UTC
The current XQUF spec forbids path expressions to be updating. This in contrast to other iterating expressions, such as FLWOR, which allows the RETURN clause to be simple, vacuous, or updating.

As path and FLWOR expressions have similar semantics, the path semantics could be extended and relaxed to the simple rule that (only) the last step of a path may be updating. The following queries would then be valid:

* //item/(delete node text())

* (1, <x/>) ! (if(. instance of node())
    then insert node text { 'X' } into . else ())

The queries can be currently be formulated as follows:

* for $i in //item
  return delete node $i/text()

* for $i in (1, <x/>)
  return if($i instance of node())
    then insert node text { 'X' } into $i else ())
Comment 1 John Snelson 2013-10-28 10:15:06 UTC
That functionality might just be better off using the "!" operator.
Comment 2 Jonathan Robie 2014-07-30 13:55:52 UTC
The Working Group decided not to add this functionality.