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

xsl:with-param

Subject: xsl:with-param
From: James Cummings <James.Cummings@xxxxxxxxx>
Date: Sun, 15 Jun 2003 20:52:54 +0100 (BST)
 xsl:with-param

Hi,

Am I misunderstanding something or should the follow xslt
snippet work:

-----
<xsl:template match="/">
<foo>
   <xsl:apply-templates mode="foo">
    <xsl:with-param name="wit">B</xsl:with-param>
  </xsl:apply-templates>
</foo>
</xsl:template>

<xsl:template match="body" mode="foo">
  <xsl:param name="wit" />
  <xsl:if test="contains(@wit, $wit)">
<body wit="{$wit}"><xsl:apply-templates mode="foo"/></body>
</xsl:if>
</xsl:template>
-----

I expected that the root template would apply any
other templates with mode="foo" and make available to
them the param $wit with value 'B'.  But the output
always has <body wit=""> ...  If I supply a default to
the xsl:param in the template body, it is of course picked
up, but not if I pass it with xsl:with-param.  Is it
something to do with using @mode with xsl:apply-templates?
Or is there something else obvious I'm missing?

Thanks for any suggestions,
-james
-- 
Dr James Cummings, James.Cummings@xxxxxxxxx, http://www.uea.ac.uk/~q503
Cursus Project, School of Music, University of East Anglia,
Norwich, Norfolk, NR4 7TJ, UK  Tel:(01603)593-595



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.