As described in the changes.html file, there were substantial changes in
this area in Saxon 7.1 to bring the product into line with the XSLT 2.0
working draft. Here's the relevant extract (do please read the
changes.html file when moving from one Saxon release to another):
The href attribute of xsl:result-document is now interpreted as a
relative URI, relative to the system ID of the principal result
document. This works only where the system ID of the principal output is
known, and uses the "file://" protocol. The result document is no longer
created relative to the current working directory, for security reasons
(it causes problems when executing an untrusted stylesheet in a servlet
Note that when Saxon is invoked from the command line, the -o option
should be used to specify the principal output destination. This will
ensure that a suitable system ID is available. If the result document is
sent to the standard output stream (even if this is redirected to a
file), Saxon will not know the system identifier and will therefore be
unable to create a secondary output destination using a relative URI. It
is still possible, of course, to specify an absolute URI as the value of
the href attribute - note that this must be a URL, not a filename, so it
will typically start with file://.
It is now possible to specify an OutputURIResolver to be used to resolve
the URI specified in the href attribute of the xsl:result-document
element. This will be used in place of the standard output URI resolver.
The OutputURIResolver is called when writing of the output document
starts, at which point it must return a JAXP Result object to act as the
output destination. It is called again when writing of an output
document is complete. You can nominate an OutputURIResolver by calling
UserOutputResolver()), or by calling
If the -t option is used, a message is written to the standard error
output identifying the files written using using xsl:result-document.
It is now an error to use xsl:result-document when the current output
destination is a temporary tree.
> -----Original Message-----
> From: saxon-help-admin@...
> [mailto:saxon-help-admin@...] On Behalf Of=20
> Sent: 29 August 2002 19:32
> To: saxon-help@...
> Subject: [saxon] hrefs in <result-document>
> I moved from 6.5.2 to 7.2 in order to use Saxon more easily=20
> from inside Ant using the trax interface. Aside from a=20
> multitude of classpath/jdk conflicts, things were going fine.
> However, when converting my stylesheets to use=20
> <xsl:result-document> instead of the former <xsl:document>, I=20
> am having a lot of trouble. The href attribute is supposed to=20
> behave much in the same way as before, but I keep getting=20
> errors unless I use file:/ AND an absolute path. Whenever I=20
> use a relative path like "./here.html" or "local.html" I get=20
> either a error or worse: the file is created in the root dir.=20
> "file:/d:/long_absolute_path_to_my_project/fil> e.html" works,=20
> but the equivalent "file:/./file.html" does=20
> not. Anyone got similar problems? Or am I missing something?=20
> hrefs worked fine in 6.5.2... I'm using JDK 1.4.1 under Win2K.
> Marcelo Jaccoud Amaral
> Petrobr=E1s (http://www.petrobras.com.br)=20
> voice: +55 21 2534-3485
> +55 21 2534-1809 =
> <>< Re: deemed!
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> saxon-help mailing list
> https://lists.sourceforge.net/lists/listinfo/s> axon-help