This seems like a silly problem.. but I can't figure out what I'm doing =
I run the following command:
%JAVA_HOME%\bin\java -jar ..\lib\saxon7.jar -o C:\temp\output.txt =
It looks like it finds ABC.xsd fine however ABC.xsd includes another =
schema, DEF.xsd which the xslt tries to load at some point.
I get the following exception:
Warning: java.io.FileNotFoundException: C:\trial\DEF.xsd (The system =
cannot find the file specified)
Error at xsl:variable on line 44 of file:/C:/trial/some.xslt:
Failed to load document DEF.xsd
Transformation failed: Run-time errors were reported
I don't understand why its looking for DEF.xsd in the directory of the =
xslt rather than the directory of the input schema. Is there any way to =
change this so that it looks for DEF.xsd where ABC.xsd is located?
Thanks in advance!
On Fri, 26 Sep 2003 21:37:20 -0400, you wrote:
>I don't understand why its looking for DEF.xsd in the=20
>directory of the xslt rather than the directory of the=20
>input schema. Is there any way to change this so that=20
>it looks for DEF.xsd where ABC.xsd is located?
You do not show us your stylesheet, but I assume that somewhere you
have what boils down to a document('DEF.xsd') call.
As the parameter is a relative URI it will look for the document in
the same place as the stylesheet. If you want to interpret relative
URIs in the context of the input document, then you need to use the
second parameter of document() to supply a node from the input
As you are getting the filename itself from the input, that probably
menas that instead of
The second will always look relative to the input document, while the
first looks relative to wherever the filename came from.
Melvaig Software Engineering Limited
voice: +44 (0) 1997 423328=20
email: tcn@... web: http://www.melvaig.co.uk
From: Michael Kay <mhk@mh...> - 2003-09-29 12:26:18
> I get the following exception:
> Warning: java.io.FileNotFoundException: C:\trial\DEF.xsd (The
> system cannot find the file specified) Error at xsl:variable
> on line 44 of file:/C:/trial/some.xslt:
> Failed to load document DEF.xsd
> Transformation failed: Run-time errors were reported
The explanations given by Trevor and Oliver are plausible, but I suspect
a different cause: the string you are passing to the document() function
is a Windows filename, not a URI.
If your source document (schema) contains a Windows filename rather than
a URI, and if you can't correct it to contain a URI, then you could
write a URIResolver that turns the filename into a URI in order to
Microsoft software tends to allow filenames in all places where URIs are
required, but this is incorrect according to the W3C specs, and Saxon
doesn't allow it.