Possible bug with xsl:result-document

Here should go questions about transforming XML with XSLT and FOP.
Mathias Müller
Posts: 2
Joined: Tue Mar 17, 2015 7:06 pm

Possible bug with xsl:result-document

Post by Mathias Müller »

(This is a cross post, the original question is: http://stackoverflow.com/questions/2907 ... ot-working)

When using the result-document facility of XSLT 2.0, "a.xml" does not work as the file name of the output document, that is, then, this document does not appear in the file system. Any other file name works, the problem is only with "a.xml".

The following code can be used to reproduce the problem, the input XML document does not matter.

Code: Select all

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<xsl:result-document method="xml" standalone="yes" href="a.xml">
<hello></hello>
</xsl:result-document>
</xsl:template>

</xsl:stylesheet>
Version information: <oXygen/> XML Editor 16.1, build 2014112517, Saxon-EE 9.5.1.7 as the XSLT processor.

Could someone of the Oxygen staff look into this?
adrian
Posts: 2854
Joined: Tue May 17, 2005 4:01 pm

Re: Possible bug with xsl:result-document

Post by adrian »

Hi,

It worked for me in v16.1 with a transformation scenario created for the XSL. The file 'a.xml' was created in the same folder as the .xsl.

Regarding xsl:result-document/@href, note that:
If the effective value is a relative URI, then it is resolved relative to the base output URI.
Did you specify an output file in the transformation scenario configuration (Output tab)?
Please check if you already have a folder named 'a.xml' in the same folder. If there's already a folder with that name, it won't be able to create a file of the same name.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Mathias Müller
Posts: 2
Joined: Tue Mar 17, 2015 7:06 pm

Re: Possible bug with xsl:result-document

Post by Mathias Müller »

Hi Adrian

Thank you for your answer. In the meantime, I realized that the problem was something completely different: The file was always created but the Finder window on Mac OS X did not properly refresh and sort the files. But from the terminal they are always visible.

By the way: Command line Saxon has an option "-t" which traces files that are read and written. I could not find this option in Oxygen. If it is really absent, perhaps it would be a good idea to include it in future versions?

Sorry for causing you extra work!
Regards

Mathias
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: Possible bug with xsl:result-document

Post by Radu »

Hi Mathias,

Sorry for the delay, we'll consider this.
In the meantime you can also switch to the debugger perspective and do a "Run to End", it will open tabs for each document saved using the result-document feature.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply