Page 1 of 1

xsl:document not supported in apply/debug?

Posted: Tue Jun 29, 2004 7:37 pm
by flo1
hi all,

my xslt transformations are outputting multiple documents from a single xml input document by using the xsl:document element. while this works perfectly in saxon 6.5.2, it does not seem to work in oxygen, although i selected saxon as xslt processor.

any hints on what i am doing wrong, or is xsl:document not supported? (which would prohibit using oxygen for me and my institution)

regards,

flo

Posted: Tue Jun 29, 2004 7:40 pm
by flo1
btw: i am using the eclips plugin with an evaluation key

Posted: Wed Jun 30, 2004 10:46 am
by george
Hi Flo,

Oxygen uses Saxon 6.5.3 and xsl:document works both from a transformation scenario and from the XSLT Debugger. There are however a couple of things you should pay attention at.

1. The stylesheet version must be different from 1.0, version 1.1 is recommended in order to have the xsl:document working [1],

2. You should make sure you are using Saxon as the XSLT processor in your transformation scenario and in debugging.

A working sample stylesheet is below:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">
<xsl:template match="/">
<xsl:document href="c:/result.html">
<h1>RESULT</h1>
</xsl:document>
</xsl:template>
</xsl:stylesheet>
[1] http://saxon.sourceforge.net/saxon6.5.3 ... l:document

Best Regards,
George

actually it's a path problem...

Posted: Wed Jun 30, 2004 11:57 am
by flo1
ah, i see... actually, it turned out to be a path problem... as the spec states, the output href is interpreted relative to the current working directory, which is c:\program files\eclipse in my case. that's were i found the output files...

any idea how to make it generate the output files in the directory of the source file? this would be a necessary enhancement, to provide some means of setting the working directory for xslt trafos.

regards,

flo

Posted: Wed Jun 30, 2004 12:45 pm
by george
Hi Flo,

We pass the system IDs for for the source and the stylesheet documents when we run a transformation. It seems that the xsl:document uses the current directory to output the files. We cannot change that, one of the reasons is that in oXygen it is possible to run several transformations in the same time, therefore changing the current directory will break previously started transformations.
A possible solution is to pass the target directory as a parameter to your stylesheet and use that in the xsl:document/@href attribute as in the sample from the saxon documentation I quoted in the previous post:

<xsl:document href="{$dir}\preface.html">

Hope that helps,
George

Posted: Wed Jun 30, 2004 4:00 pm
by flo1
hi,

i could work around the problem by using the approach you suggested. however, i have a RFE: it would be *amazing* if the output view would show the current output context (i.e. document) if the debugger is currently inside an xsl:document element.

i have no idea however how much effort it would be to implement this...

f/0