xsl-list
[Top] [All Lists]

Re: Preserve HTML formatting when apply-templates in variabl

2004-08-06 01:50:47
Hi Karl,

The variable which should retrieve the HTML from the matched
template is "ui_review". The template "review" is responsible for
generating the HTML.

I suspect that in your ui_content template you're doing:

  <xsl:value-of select="$content" />

The <xsl:value-of> instruction gives you the "string value" of
whatever you select; in the case of a result tree fragment (such as
$ui_review), this is a concatenation of all the text nodes in the
result tree fragment. What you see is the HTML you generated but with
all the tags stripped.

Instead, do:

  <xsl:copy-of select="$content" />

This gives you a copy of the result tree fragment, including all the
element and attribute nodes that it contains. What you see is the HTML
that you generated.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/