xsl-list
[Top] [All Lists]

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

2005-09-08 12:04:39
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(_at_)mulberrytech(_dot_)com
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
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>