[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Value-Of a Parameter

Subject: Re: Value-Of a Parameter
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 4 Sep 2001 10:41:14 +0100
Re:  Value-Of a Parameter
Hi Tanzila,

> Attempt 1:
> <xsl:param name="xmlFile" select="document('spanish.xml')"></xsl:param>
> <!--where xmlFile is passed in as - document('spanish.xml')-->

$xmlFile is being passed in as *the string* "document('spanish.xml')".
The processor doesn't evaluate that string, so the parameter is just
set to the literal string. When you use a parameter at the start of
the path, it has to be a node set rather than a string, which is why
you get the error message.

>               <xsl:value-of select="document('$xmlFile')//organisation"/>
[snip]
>
> The value of the xmlFile is not returned i.e. the following message
> is displayed "can't find the file $xmlFile".

The quotes around '$xmlFile' in the above call to document() mean that
you're passing in the literal string '$xmlFile' as the argument to
document(), not the value of the $xmlFile parameter. You haven't got a
file called '$xmlFile' on your system, so it doesn't find one.

You need to set the parameter as you do in the second attempt, to
"spanish.xml", and then pass the value of the parameter in as the
argument by removing the quotes. Use:

  <xsl:value-of select="document($xmlFile)//organisation" />

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.