|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Evaluate xsl:param in Xalan extension element
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








