Page 1 of 1

make XSLT overriding output specs in transformation scenario optional

Posted: Wed Sep 06, 2017 4:16 pm
by Martin de la Iglesia
When I created a custom transformation scenario, the HTML output didn't work at first, and it took me some time to figure out that the <xsl:result-document> in my XSLT stylesheet was overriding the settings I had set in the transformation scenario editing window. Therefore I'd like to suggest adding a checkbox to the transformation scenario editing window that specifies whether the XSLT should override the scenario settings or vice versa.

Re: make XSLT overriding output specs in transformation scenario optional

Posted: Wed Sep 06, 2017 5:37 pm
by adrian
Hi,

Could you please clarify what exact settings are you referring to?
What settings did you set in the transformation scenario editing window and what attribute from the xsl:result-document overrode those settings?

This may not be an Oxygen matter, but an XSLT transformer (e.g. Saxon) matter. What you specify for xsl:result-document is for the XSLT transformer, so Oxygen is unlikely to be able to control what the transformer does with those settings.

Regards,
Adrian

Re: make XSLT overriding output specs in transformation scenario optional

Posted: Thu Sep 07, 2017 10:29 am
by Martin de la Iglesia
In the "Edit scenario" window (in oXygen 17.1 on Windows), all settings in the "Output" tab, such as "Prompt for file" and "Open in Browser/System Application", were ignored. This only changed when I removed the <xsl:result-document> from my stylesheet, so I assume the latter had been overriding the former.

Re: make XSLT overriding output specs in transformation scenario optional

Posted: Thu Sep 07, 2017 11:47 am
by adrian
Hi,

"Prompt for file" and "Open in Browser/System Application" (with "Saved File") apply to the default output of the XSL transformation. They are not used for xsl:result-document which tells the transformer to output to a custom location and file specified by the @href attribute (xsl:result-document file location cannot be overridden). xsl:result-document is mostly used when you want to output to multiple files, each file by a xsl:result-document instruction.

If you want to open the output of a single xsl:result-document, you need to specify "Open in Browser/System Application" with "Other location" and specify there the location where the xsl:result-document writes the file.

Regards,
Adrian

Re: make XSLT overriding output specs in transformation scenario optional

Posted: Thu Sep 07, 2017 12:28 pm
by Martin de la Iglesia
If you want to open the output of a single xsl:result-document, you need to specify "Open in Browser/System Application" with "Other location" and specify there the location where the xsl:result-document writes the file.
This doesn't work for me: when I have a <xsl:result-document> in my stylesheet, the browser doesn't open. Only when I remove the <xsl:result-document> instruction from my XSLT, the "Open in Browser" option works.

Re: make XSLT overriding output specs in transformation scenario optional

Posted: Thu Sep 07, 2017 12:31 pm
by adrian
Hi,

You need to specify the in the "Other location" field the file path of the file to be opened (that was created by xsl:result-document).

Regards,
Adrian

Re: make XSLT overriding output specs in transformation scenario optional

Posted: Thu Sep 07, 2017 12:53 pm
by Martin de la Iglesia
I had specified it, and at first it didn't work. However, I just closed and re-opened oXygen, and now it works. So, thank you for the hint, Adrian.
Still, I wish there was a short note, either displayed directly in the "Edit scenario" window or at least in the Help text (https://www.oxygenxml.com/doc/versions/ ... ialog.html), that warns the user of a potential conflict when a <xsl:result-document> is set.

Re: make XSLT overriding output specs in transformation scenario optional

Posted: Thu Sep 07, 2017 4:25 pm
by adrian
Hi,
I had specified it, and at first it didn't work. However, I just closed and re-opened oXygen, and now it works.
I'm guessing you specified just the file name there, that's why it worked only after a restart. The folder path to the file is also required.
e.g. ${cfd}/myfilename.xml where ${cfd} is expanded by Oxygen to the "current file directory".
Still, I wish there was a short note, either displayed directly in the "Edit scenario" window or at least in the Help text (https://www.oxygenxml.com/doc/versions/ ... ialog.html), that warns the user of a potential conflict when a <xsl:result-document> is set.
I'll log your request, but note that there is no conflict. xsl:result-document by definition is meant to provide the possibility of output to a secondary output destination.
So it is expected that the XSLT transformation output settings that Oxygen provides for the default output does not apply to xsl:result-document.

Regards,
Adrian