This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: passing variables to a stylesheet
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] passing variables to a stylesheet
- From: Jörg Heinicke <joerg dot heinicke at gmx dot de>
- Date: Sat, 13 Oct 2001 23:36:07 +0200
- References: <000e01c144df$e79d0e30$c31381c3@eris.net800.co.uk> <00fc01c144e0$7720dcd0$9e01a8c0@ROSEBUD> <20010924141346.B12925@apple.fruitcom.com> <017301c144f5$2b721e60$9e01a8c0@ROSEBUD> <20011013220714.L13145@apple.fruitcom.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Do you have a
<xsl:param name="somecondition">standard value if no param was sent to the
stylesheet</xsl:param>
as toplevel-element (as child of <xsl:stylesheet>) in your stylesheet? Then
there should be no problem. You get at least the standard value of the
param.
Joerg
----- Original Message -----
From: "Eric Smith" <Eric.Smith@fruitcom.com>
To: <xsl-list@lists.mulberrytech.com>
Sent: Saturday, October 13, 2001 10:07 PM
Subject: Re: [xsl] passing variables to a stylesheet
> According to cutlass on Mon, Sep 24, 2001 at 01:33:52PM +0100:
> > most command line invocations provide a way of passing params; though
they
> > are slightly different with each parser.
> >
> > a command line invocation using instant saxon with 2 params p1.
> >
> > saxon source.xml source.xsl p1="aaa"
> >
>
> Could someone tell me how they pass parameters to their stylesheets
> using xalan.
>
> The docs say:
> [-PARAM name expression (Set a stylesheet parameter)]
>
> So I use org.apache.xalan.xslt.Process -PARAM someconditon 1 -IN some.xml
> -XSL some .xsl
>
> But that gives the error:
> org.apache.xml.utils.WrappedRuntimeException: Could not find
> variable with the name of somecondition
>
> Do they mean variable when they say set a parameter, am I missing
> something here?
>
> I want to do form the commandline the same thing as:
> <xsl:variable name="somecondition" select="1"/>
>
> thanx
> --
> Eric Smith - See mail headers for processors used
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list