Re: [xsl] Named template param - variable not found

Subject: Re: [xsl] Named template param - variable not found
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 26 Oct 2007 23:01:44 -0400
At 2007-10-27 11:33 +1000, Matthew Lindfield Seager wrote:
I have previously had no troubles getting named templates to work
however I am struggling to get a fairly basic navigation menu to
work. I'm using TestXSLT and when I attempt to process the page using
Sablotron, Saxon or Xalan-J I get an error (along the lines of
variable "currentPage" not found). Libxslt will process it but the
result has a superfluous "<param name="currentPage">" in the body of
the html.

That's the clue to tell you what's up ... XSLT instructions never show up in the result tree.

An extremely cut down version of the xsl file is included below. I
have tried using a select attribute with the supplied parameter
(select="'Accounts'") but the result is the same. I have also tried
modifying the test in the <xsl:when> block but that hasn't worked

Am I making a subtle mistake or am I completely off the rails?

Don't kick yourself, but all you've done is forgotten the "xsl:" prefix for the param.

Therefore, as you have it now it is a literal result element and doesn't exist as an instruction, the variable reference is not in scope, and the literal result element shows up in your HTML.

I hope this helps.

. . . . . . . . . . . Ken

Comprehensive in-depth XSLT2/XSL-FO1.1 classes: Austin TX,Jan-2008
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Jul'07
Legal business disclaimers:

Current Thread