RE: [xsl] Apply-templates - how to omit top level element tags?

Subject: RE: [xsl] Apply-templates - how to omit top level element tags?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 08 Sep 2005 15:04:39 -0400
Mike,

At 02:45 PM 9/8/2005, you wrote:
>> Part of your problem is that you are using xsl:value-of rather than
xsl:copy-of, value-of always

As I understand it, copy-of does a literal copy, and does not apply any
templates, right?

That's correct: copy-of copies a node and all its attributes and descendants, unchanged, to the result tree in that position.


value-of copies the string value of a node to the result. The string value of a text node is the text in the node; the string value of an element node is the concatenation of all its text node descendants. So the value of

<p>Hey this is <sarcasm>fun</sarcasm>!</p>

is "Hey this is fun!"

(losing the <sarcasm>.)

If more than one node is selected by value-of, only the string value of the first of the nodes (in document order) is copied to the result.

Cheers,
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 ======================================================================

Current Thread