This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
RE: xalan params
- From: Jeff Beal <jeff dot beal at ansys dot com>
- To: 'Eric Richardson' <eric dot richardson at milagrosoft dot com>,"DocBook Mailing List (E-mail)" <docbook-apps at lists dot oasis-open dot org>
- Date: Fri, 12 Apr 2002 11:50:46 -0400
- Subject: RE: DOCBOOK-APPS: xalan params
Change this line:
<xsl:text>The param test = $test</xsl:text>
to this:
<xsl:text>The param test= </xsl:text><xsl:value-of select="$test"/>
Jeff Beal
Ansys, Inc.
(724)514-3150
jeff.beal@ansys.com
-----Original Message-----
From: Eric Richardson [mailto:eric.richardson@milagrosoft.com]
Sent: Friday, April 12, 2002 11:09 AM
To: Jeff Beal
Subject: Re: DOCBOOK-APPS: xalan params
Hi Jeff,
Thanks. It still doesn't work. I'm I using it wrong?
passed in
-PARAM test testvalue
<!-- test param passed to xalan -->
<xsl:param name="test"/>
<xsl:template match="/">
<xsl:text>The param test = $test</xsl:text>
</xsl:template>
My output is as follows:
The param test = $test
Eric
Jeff Beal wrote:
> The name attribute of the <xsl:param> needs to be the same as the
parameter
> you place on the command line.
>
> For example, if you want to use the name "test" everywhere, then you
should
> have this at the top of your XSL file:
> <xsl:param name="test"/>
>
> You can leave this empty, or define a default value. The value you place
on
> the command-line will override whatever is in the XSL file.
>
> Jeff Beal
> Ansys, Inc.
> (724)514-3150
> jeff.beal@ansys.com
>
> -----Original Message-----
> From: Eric Richardson [mailto:eric.richardson@milagrosoft.com]
> Sent: Thursday, April 11, 2002 9:35 PM
> To: docbook
> Subject: DOCBOOK-APPS: xalan params
>
> Hi,
>
> I'm trying to pass a param to xalan command line as follows:
>
> java org.apache.xalan.xslt.Process -PARAM test testvalue -IN ....
>
> In my driver file I'm trying to get at it but it can't find it.
>
> file:///home/maxwell/pws/jdocbook/drivers/xhtmldriver.xsl; Line 10;
> Column 42; XSLT Error
> (javax.xml.transform.TransformerConfigurationException):
> javax.xml.transform.TransformerException:
> org.apache.xml.utils.WrappedRuntimeException: Could not find variable
> with the name of test
>
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version='1.0'>
>
> <xsl:import href="../docbook-xsl/xhtml/docbook.xsl"/>
>
> <!-- print test param passed from xalan -->
> <xsl:param name="testin" select="$test"/>
>
> <xsl:template match="/">
> <xsl:text>The param test = "$testin"</xsl:text>
> </xsl:template>
>
> rest of stylesheet.
>
> Any ideas?
>
> Thanks,
> Eric
>
>