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

Re: Strange Problem with document($variablename)

Subject: Re: Strange Problem with document($variablename)
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 11 Jul 2003 12:43:44 +0100
java.io.filenotfound
Hi Torsten,

> Using <p><xsl:value-of select="$filename"/></p> the correct filename
> is being printed.
>
> (For example ../content/news/foo" if @name == foo.)
>
> Using document($filename) I get a java.io.FileNotFound exception for
> "../content/news/" (where is the foo gone; it the identical
> variable!!!).

That's very peculiar. If you want an equivalent variable, try using
the concat() function:

<xsl:variable name="filename"
              select="concat('../content/news/', @name)" />

I doubt that it will give you a different result.

By the way, the reason that the file isn't found might be because the
URL is being resolved relative to the directory that the stylesheet
lives in rather than the directory that the XML document lives in. Try
using:

  document($filename, .)

to get the $filename URL to be resolved relative to the current
<directory> element.

Cheers,

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.