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 16603 - [XQ31ReqUC] Shallow copy constructors
Summary: [XQ31ReqUC] Shallow copy constructors
Status: NEW
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Requirements for Future Versions (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 18:57 UTC by Evan Lenz
Modified: 2014-05-20 16:51 UTC (History)
1 user (show)

See Also:


Attachments

Description Evan Lenz 2012-04-02 18:57:15 UTC
It would be nice if XQuery 3.0 provided a way to perform a shallow copy of the context node while preserving its namespace context (like <xsl:copy> in XSLT).

In the current draft, the only way to do that would be to write the following:

$el !
element {node-name(.)} {
  for $prefix in in-scope-prefixes(.)
  let $uri := namespace-uri-for-prefix($prefix, .)
  return namespace {$prefix} {$uri},
  "new-value"
}

whereas in XSLT, you'd just write:

<xsl:copy>new-value</xsl:copy>

It would be nice if XQuery 3.0 provided a simpler way to do this, e.g., through a shallow copy constructor, using syntax that looks something like this:

copy {...}

So the above example could be written like this instead:

$el ! copy { "new-value" }
Comment 1 Jonathan Robie 2014-05-20 16:51:07 UTC
Assigning to future requirements per Working Group decision (https://lists.w3.org/Archives/Member/w3c-xsl-query/2012Oct/0087.html).