[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|