Re: [xsl] Selecting unparsed text from inside a tag

Subject: Re: [xsl] Selecting unparsed text from inside a tag
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 25 Mar 2008 10:10:05 +0100
Jefferson Thomas wrote:
<snip />

<xsl:value-of select="."/>

<snip />

So the difference is that the <br/> and <img> would also come up. As
for now I couldnt find any way for that.
Does somebody know how to do it ?

The instruction xsl:value-of does what it says: it takes the value of the node you select (and in terms of XSLT, and using the short explanation, a value is the text-value of a node). What you want is the instruction xsl:copy-of, which creates an exact copy of the node.


Btw, XSLT is not aware of tags, it is aware of nodes. A node of type element consists of three parts: an opening tag, the content, the closing tag. For XSLT, this is an atomic unit: a node. Compare it to a DOM node, which doesn't have information on tags either.

Cheers,
-- Abel Braaksma

Current Thread