[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Determining the context node

Subject: Re: Determining the context node
From: Evan Lenz <evan@xxxxxxxxxxxx>
Date: Fri, 14 Apr 2006 08:30:23 -0700
determining node types
I wrote:
contained other elements) you would get nothing.
For all node types except for elements, <xsl:copy/> behaves exactly the same as <xsl:copy-of select="."/>
I should qualify that. If the current node is a root node, then it just instantiates the content of <xsl:copy> (no different than if <xsl:copy> weren't there). That's because you never copy root nodes (they're created automatically).

The way the XSLT 1.0 spec defines <xsl:copy> is that it copies the current node but excludes any children or attributes of the current node.

Effectively, for nodes that never have children or attributes anyway (namely: attributes, text nodes, processing instructions, namespace nodes, and comments), the behavior is the same as <xsl:copy-of select="."/>.

However, for elements and root nodes, <xsl:copy-of select="."/> performs a deep copy, including all attributes (when the current node is an element) and child nodes (when the current node is an element or root node).


Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.