Vitali Gontsharuk wrote:
> When using the XPATH document() function to load a new XML document,
XPath 1.0 has no function named document, only XSLT 1.0 knows that function.
> we
> are coming across problems, because XALAN seems to have problems with
> absolute paths. XALAN always assumes that the path is relative to the
> current directory. So if we e.g. are in "c:\xslt_scripts" and are trying
> to load an XML file from "c:\xml_files\test.xml" it ist trying to open a
> file with the following absolute path:
> "c:\xslt_scripts\c:\xml_files\test.xml".
I don't know what Xalan does but usually the argument is treated as a
URI reference and "c:\xml_files\test.xml" is not a URI so you would at
least need
file:///C:/xml_files/test.xml
if you want to load from the file system.
As for resolving relative URIs, the base URI used depends on the second
argument to the document function, here is what the spec says about
that: "The URI reference may be relative. The base URI (see [3.2 Base
URI]) of the node in the second argument node-set that is first in
document order is used as the base URI for resolving the relative URI
into an absolute URI. If the second argument is omitted, then it
defaults to the node in the stylesheet that contains the expression that
includes the call to the document function."
--
Martin Honnen
http://JavaScript.FAQTs.com/