Page 1 of 1
Output directory with XT custom engine...
Posted: Wed Oct 13, 2010 10:07 pm
by petekarn
Hello. First time user of oXygen. Am trying to set up a transformation scenario using XT to transform XML into HTML (I'm using XT because it's the multiple document extension in XT that I need). I got it to transform, but the output files always go to the Oxygen application main directory instead of the directory I assign. I assigned the output dir in the Edit Scenario > Output tab, but again, nothing goes there. Any help is appreciated. TIA
Re: Output directory with XT custom engine...
Posted: Thu Oct 14, 2010 12:00 pm
by adrian
Hello,
How did you configure XT in Oxygen?
If you have configured it as a custom XSLT engine(Options -> Preferences -> XML -> XSLT-FO-XQuery -> Custom Engines), make sure you also specify the output(result) argument in its command line: ${out}
e.g.
java -cp xp.jar;xt20051206.jar com.jclark.xsl.sax.Driver ${xml} ${xsl} ${out}
Another way of configuring XT in Oxygen is via the JAXP API.
1. Copy the XT jar(xt20051206.jar) to the lib folder from the Oxygen installation folder and restart Oxygen.
2. In Options -> Preferences -> XML -> XSLT-FO-XQuery -> XSLT, JAXP XSLT Transformer, in the Value field use: com.jclark.xsl.trax.TransformerFactoryImpl
Then, in the transformation scenario(Document -> Transformation -> Configure Transformation Scenario, Edit) you can select JAXP from the Transformer combo and XT will be used.
PS: Multiple documents can also be generated with XSLT 2.0(and Saxon-HE/PE/EE) via xsl:result-document.
Regards,
Adrian
Re: Output directory with XT custom engine...
Posted: Thu Oct 14, 2010 8:43 pm
by petekarn
Thanks for the reply and config info, Adrian. I have tried configuring it both ways that you have demonstrated. However, the problem persists; the output goes into the oXygen application folder. I have set a working folder in the Custom Engine congif, but nothing ever goes there, either. Where is the ${out} variable assigned? I tried the output tab when transforming using JAXP, but again, nothing happens. In fact, it wants me to choose a file and now a folder. Thanks.
Re: Output directory with XT custom engine...
Posted: Thu Oct 14, 2010 9:08 pm
by petekarn
I just noticed that today, without changing anything, it now wants to write all my output to the Windows\system32 folder! Where could that come from?
Re: Output directory with XT custom engine...
Posted: Fri Oct 15, 2010 12:31 pm
by adrian
It's probably generating the output in the current folder(whichever that may be). This means there's still something wrong in the command line configuration.
Did you use ${out} as the third argument after the Java class name(Driver)?
Also, use quotes to make sure the arguments don't get mixed up when they contain space:
e.g.
java -cp xp.jar;xt20051206.jar com.jclark.xsl.sax.Driver "${xml}" "${xsl}" "${out}"
The ${out} variable is replaced with the file path specified in the "Save as" field from Edit Scenario -> Output tab. Make sure you specify a filename and there(not a folder). e.g. /path/to/my/file/result.xml
If that field is empty a temporary file is used.
Regards,
Adrian
Re: Output directory with XT custom engine...
Posted: Mon Oct 18, 2010 10:50 pm
by petekarn
Hello again Adrian. I was able to get the custom engine working with the following line:
java -cp "C:\XP\xp.jar";"C:\xt-20051206\lib\xt20051206.jar" com.jclark.xsl.sax.Driver ${xml} ${xsl} "\\server0010\Applications\training\test.htm"
I think the biggest problem was I was missing the -cp after the java. I also had to setup a 'dummy' html file called 'test.htm' as the target. If I tried to use the index.htm file that is part of my generated file list, it ended up writing it incorrectly. I will probably move away from XT in the near future. Thanks again for you help!
Re: Output directory with XT custom engine...
Posted: Tue Oct 19, 2010 10:49 am
by adrian
You should replace "\\server0010\Applications\training\test.htm" with ${out} to allow the transformation scenario to specify the output.
Regards,
Adrian