[Bug 16603] New: Shallow copy constructors

https://www.w3.org/Bugs/Public/show_bug.cgi?id=16603

           Summary: Shallow copy constructors
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery 3.0
        AssignedTo: jonathan.robie@gmail.com
        ReportedBy: evan@evanlenz.net
         QAContact: public-qt-comments@w3.org


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" }

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 2 April 2012 18:57:19 UTC