If you pass a node to the document function (for example
document(@filename)), then the function takes the string value of the node, and
if this is a relative URI, resolves it against the base URI of that
If you pass a string to the document function (for example
document(concat("", @filename))) then the relative URI is resolved against the
base URI of the stylesheet.
I imagine this accounts for the difference.
You could use the second argument of document() to change
or you could use functions such as base-uri(),
static-base-uri(), and resolve-uri() to control the URI resolution "by
writing something that generates xsl fiels on the fly. The input is a
mapping document taht can refer to documents through an include. these
documents are to be local to the mapoing document not the xsl stylesheet that
is processing the mapping file.
The following is a
portion of my xsl sheet:
Path is declared as
I get a warning if I
use the $filename that the file can not be found, but I get the correct
results if I simply pass the attribute @filename to the document
function. Can you please explain what is happing and how I can get the
desired result, i.e. find a file relative to the input file not the