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

Evaluate xsl:param in Xalan extension element

Subject: Evaluate xsl:param in Xalan extension element
From: Paul Brady <paul.brady@xxxxxxxxxxx>
Date: Tue, 26 Nov 2002 16:42:44 -0000
xalan param
I have an extension element written for xalan which takes a parameter which
specifies the name of a template to execute. It is really a dynamic
call-template. I am trying to port the extension element from xalan v1.2 to
v2.3.1. The problem I am having is that I can't figure out how to get the
value of a parameter that was passed to the containing template. 
Example:

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:dynamicTemplate="org.apache.xalan.xslt.DynamicTemplate"
    extension-element-prefixes="dynamicTemplate">

    <xsl:template match="/">
        <xsl:call-template name="DocletContentBody">
            <xsl:with-param name="docletTemplate">test</xsl:with-param>
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="DocletContentBody">
        <xsl:param name="docletTemplate"/>

        <dynamicTemplate:dynamicCallTemplate name="docletTemplate">
            <xsl:call-template name="doesntMatter">
            </xsl:call-template>
        </dynamicTemplate:dynamicCallTemplate>
    </xsl:template>

    <xsl:template name="test">
    </xsl:template>
</xsl:stylesheet>

The Extension element is called dynamicTemplate. When called, it attempts to
evaluate the value of the docletTemplate param. This specifies the name of
the template to execute. 

My xalan 1.2 version achieved this by simply 
String strTemplateName = xslprocessorcontext.processor.getVariable(new
QName(strName)).str();

But in the 2.3.1, it seems that parameters are somehow lazily evaluated and
using getParam() or getVariableOrParam() always returns null?

Any help would be greatly appreciated.

Paul.

 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.