Altova Mailing List Archives

Re: [xsl] Preserve HTML formatting when apply-templates in variabl

From: Jeni Tennison <jeni@---------------->
Date: 8/6/2004 8:51:00 AM
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.



Jeni Tennison


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.