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

Re: xsl template parameter passing

Subject: Re: xsl template parameter passing
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 08 Dec 2004 19:26:47 -0500
xsl template parameter
Samuel,

You are almost there ... you only need to use xsl:copy-of instead of xsl:value-of in your named template.

Then the result-tree-fragment you are passing in as a parameter will be copied out. xsl:value-of copies only strings, not subtrees.

Cheers,
Wendell

At 07:22 PM 12/8/2004, you wrote:
I was wondering if anyone has done something similar
to what I need done.

I have to show users an error whenever something goes
wrong. I have a template such as this:

<xsl:template name="errorbox">
<xsl:param name="message" select="''" />
<div class="errorbox">
<h2><xsl:value-of
select="$lang.NBoxError"/>:<xsl:text> </xsl:text></h2>
<div class="boxcontent">
<xsl:value-of select="$message"/>

... say <xsl:copy-of select="$message"/> here ...


</div>
</div>
</xsl:template>

this works fine if "$message" is only text. however,
many times, a link needs to be included in the
"message" portion. so i dont know how to call a
template, and pass in the "body" of the message, which
can contain html. and use xsl to generate that html.
I've tried something like this, but does not work:

<xsl:call-template name="errorbox" >
<xsl:with-param name="message" >
<a>
<xsl:attribute name="href">URLTEXT</xsl:attribute>
Link
</a>
</xsl:with-param>
</xsl:call-template>

please help.


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

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.