[xsl] Using a template's (HTML) output as with-param?

Subject: [xsl] Using a template's (HTML) output as with-param?
From: "Talley, Brooks" <brooks@xxxxxxxx>
Date: Thu, 8 Dec 2005 17:10:54 -0800
I'm pulling my hair out.

I've got an xslt template in an include file that's designed to return a
complete <a> tag, with href and inner text and all (many xslt templates
use this include so I don't have to hardcode url's in each template).
So far, so good.

However, now I need to use that template's output as a parameter to
another template that's designed to put some formatting on a table
heading.  Everything works great... Except my <a> tag disappears when I
use it this way.  In fact, *any* html markup disappears, as show below:

URL template:

	<xsl:template name="HrefTest">
		<xsl:text><h3>test</h3></xsl:text>
	</xsl:template>

Caption template:
	<xsl:template name="TableHeader">
		<xsl:param name="caption1" />
		<xsl:param name="caption2" />
		<tr><td><h1><xsl:value-of select="$caption1"
/></h1></td></tr>
		<tr><td><xsl:value-of select="$caption2" /></td></tr>
	</xsl:template>

Usage:
	<table>
		<xsl:call-template name="TableHeader">
			<xsl:with-param name="caption1">First
Caption</xsl:with-param>
			<xsl:with-param name="caption2">
				<xsl:call-template name="HrefTest" />
			</xsl:with-param>
		</xsl:call-template>
	</table>

Expected result:
<table><tr><td><h1>First
Caption</h1></td></tr><tr><td><h3>test</h3></td></tr></table>

Actual result:
<table><tr><td><h1>First
Caption</h1></td></tr><tr><td>test</td></tr></table>

No errors or anything, the tags just disappear.  This is msxml6.  Is
this expected behavior, or do I need to somehow escape those tags, or
what?

Thanks
-b

Current Thread