Re: [xsl] Behavior of document() Function with Empty String

Subject: Re: [xsl] Behavior of document() Function with Empty String
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 18 Dec 2006 09:26:10 +0000
On 12/17/06, Abel Braaksma <abel.online@xxxxxxxxx> wrote:
Colin Paul Adams wrote:
> Whatever, I agree with your conclusion that you cannot rely on
> document ('') working.
>

Though I don't fully understand what the phrase "no base uri" may mean
here in this discussion, I think it's in place here to state that
document('') never works once you offset the base uri by using xml:base
in the xsl:stylesheet element, or in any direct ancestor to the element
containing the document('') instruction.

In a particular project of us, all stylesheets from a stylesheet library
are located in a certain directory structure, deeper nested than the
input/output sources location. To get easy access to the paths of
input/output and for all stylesheets to "see" the same directory
structure, all those stylesheets have an xml:base instruction of
"../..". This has the (uncanny) side benefit of effectively disabling
the call to document('').

Isn't it because the stylesheet doesn't actually live at the location that xml:base is referring to, therefore no XML file is returned? So it's not that uncanny, just that there's nothing to return.

Current Thread