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

Re: Value-of, copy-of

Subject: Re: Value-of, copy-of
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 27 Feb 2002 12:51:14 -0500
value of copy of
Mike and Eric,

Mini XPath abbreviations lesson:

[1] '.' is short for 'self::node()'

so <xsl:copy-of select="."/> is saying "copy the context node".

[2] 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

<xsl:copy-of select="node()"/>

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


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.