[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: Using a template's (HTML) output as with-param?
From: "Talley, Brooks" <brooks@xxxxxxxx>
Date: Thu, 8 Dec 2005 17:10:54 -0800
template s
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.