Re: Value-of, copy-of
Mini XPath abbreviations lesson:
 '.' is short for 'self::node()'
so <xsl:copy-of select="."/> is saying "copy the context node".
 if no axis is given in the step of a location path, interpolate "child::"
so <xsl:copy-of select="node()"/> is short for <xsl:copy-of select="child::node()"/>, i.e. "copy the child nodes of the context node".
This is what accounts for the behavior you're seeing.
At 12:17 PM 2/27/2002, Mike wrote:
I changed my style sheet and got the results I wanted. I read on p. 187 of Kay's book (1st edition) that copy-of is gives you the content without the opening and closing tag of the node, if you use it with
Strictly speaking, it's not that the node is copied without its tags -- it's that the node is not copied, but all its children are. (Tags only appear when and if the result tree gets serialized as markup.)
He also says that xsl:copy-of does not allow you to controll what nodes are being included in the output (p. 182), but xsl:copy does. That was another problem I am having.
Yep: xsl:copy-of gives you a "deep copy" (all the way down from the node you copy), while xsl:copy only copies one level, while allowing you include more instructions (such as apply-templates) to graft more stuff under the node you've copied.
I hope that clears things up a bit, Wendell
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
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