Re: [xsl] Unable to get text() of node

Subject: Re: [xsl] Unable to get text() of node
From: andrew welch <andrew.j.welch@xxxxxxxxx>
Date: Mon, 23 Jan 2006 13:10:01 +0000
> No, copy-of literally copies the selected nodes. If you select text(), it
copies all text child
> nodes of the current node. If you select ., it copies the current node
itself, including its start
> and end tag and all it's descendants, resulting in:

I know what you meant so sorry to be a bit pedantic, but xsl:copy-of
doesn't copy "start and end tags" - the concept of start and end tags
don't exist at that point, only a node in a tree in memory.

In other words, there is a node in the source XML tree which gets
copied to result tree.  The serializer passes over this in memory tree
and writes out the single node as start and end tags in whatever is
being written to (file, socket, screen etc).

This is a common hurdle in learning XSLT - an input tree gets
transformed to a result tree, you can't insert start and end tags
because they dont exist at transform time.

cheers
andrew

Current Thread