xsl-list
[Top] [All Lists]

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

2007-10-26 20:02:25
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
either.

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(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Jul'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>