You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Jian, David" <DJ...@priceinteractive.com> on 2001/01/05 17:49:25 UTC
Test UseStylesheetParam
I have a question about the UseStylesheetParam. If I run it as:
java UseStylesheetParam /
I get:
<?xml version="1.0"?>
<out>/</out>
But if I hard code $param1 in foo.xsl as:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="param1" select="'default value'"/>
<xsl:template match="doc">
<out><xsl:value-of select="/"/></out>
</xsl:template>
</xsl:stylesheet>
I get:
<?xml version="1.0"?>
<out>Hello</out>
It looks like it only pass "'/'". How can I pass the "/" to foo.xls in run
time and get "Hello"?
Thanks
DJ
Re: Test UseStylesheetParam
Posted by Gary L Peskin <ga...@firstech.com>.
"Jian, David" wrote:
>
> I have a question about the UseStylesheetParam. If I run it as:
>
> java UseStylesheetParam /
>
> I get:
>
> <?xml version="1.0"?>
> <out>/</out>
>
> But if I hard code $param1 in foo.xsl as:
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:param name="param1" select="'default value'"/>
> <xsl:template match="doc">
> <out><xsl:value-of select="/"/></out>
> </xsl:template>
> </xsl:stylesheet>
>
> I get:
>
> <?xml version="1.0"?>
> <out>Hello</out>
>
> It looks like it only pass "'/'". How can I pass the "/" to foo.xls in run
> time and get "Hello"?
The setStylesheetParam call in UseStylesheetParam.java passes in the
command line argument as a string. What you want to do is pass in the
expression "/" and have it evaluated at execution time. Have a look at
the evaluate extension function in XalanJ2.
Gary