This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Value-Of a Parameter
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Value-Of a Parameter
- From: "Tanzila Mohammad" <tmohammad at entier-solutions dot com>
- Date: Tue, 4 Sep 2001 10:26:54 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
I attempted the following in my xsl using Xalan Processor:
Attempt 1:
<xsl:param name="xmlFile" select="document('spanish.xml')"></xsl:param>
<!--where xmlFile is passed in as - document('spanish.xml')-->
<xsl:template match="/">
<html>
<head> </head>
<body>
<font color="#CC0000">
<xsl:value-of select="$xmlFile//organisation"/>
</font> <br/>
<font color="#CC0000">
</font>
</body>
</html>
</xsl:template>
Returned the following error: "#String Node List Error"
Attempt 2:
<xsl:param name="xmlFile"></xsl:param> <!--where xmlFile is passed in as
spanish.xml-->
<xsl:template match="/">
<html>
<head> </head>
<body>
<font color="#CC0000">
<xsl:value-of select="document('$xmlFile')//organisation"/>
</font> <br/>
<font color="#CC0000">
</font>
</body>
</html>
</xsl:template>
The value of the xmlFile is not returned i.e. the following message is
displayed "can't find the file $xmlFile".
Attempt 3:
<xsl:template match="/">
<html>
<head> </head>
<body>
<font color="#CC0000">
<xsl:value-of select="document('spanish.xml')//organisation"/>
</font> <br/>
<font color="#CC0000">
</font>
</body>
</html>
</xsl:template>
This works fine but I need the value of the xmlFile passed in as a
parameter.
How do I get the value of the xmlFile parameter but using either Attempt 1
or Attempt 2?
Thanks
Tanzila
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list