Re: Determining the context node
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).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="."/>
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).
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format