Re: [xslt] Parameters on the command line



On Friday, Jun 20, 2003, at 10:41 America/Montreal, Kraft, Rich wrote:

2 problems:

> I am executing:
> xsltproc --param paramx y vehicles.xsl cardata.xml

You need to escape the y since its a string, not a select pattern:

xsltproc --param paramx "'y'" vehicles.xsl cardata.xml

>
> and the xsl has:

the param is a gobal param that need to be defined outside of a 
template:

<xsl:param name="paramx"/>

You can set a default 'x' value:

<xsl:param name="paramx" select="'x'"/>

Francois

>
> <xsl:template match="profile">
>     <xsl:param name="paramx"/>
>     <xsl:value-of select="$paramx"/>
> </xsl:template>
>
> But the 'y' never shows up.
>
> (profile is the main element in cardata.xml)
>
> Any help you can give me would be greatly appreciated.
>
> _______________________________________________
> xslt mailing list, project page http://xmlsoft.org/XSLT/
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]