Page 1 of 1

XSL Debugger: Quickly diff result against source

Posted: Tue Dec 05, 2017 4:50 am
by dcramer
After running an xslt in the debugger, I'd love it if there were a button that would open the output and the source document for that transform in the xml diff tool. That way I can quickly confirm that the transform changed what I wanted it to change and didn't touch anything it wasn't supposed to. As it is, I have to save the result to a file, then open both in the diff tool.

Regards,
David

Re: XSL Debugger: Quickly diff result against source

Posted: Tue Dec 05, 2017 4:19 pm
by adrian
Hi,

Thank you for the feedback.
While diffing the output against the input may be useful for a specific use case, it is a very specific use case (input and output need to be very similar).
I'll log it as a feature request, but IMHO, since this has a very limited use, it won't be adopted.

As it is, I have to save the result to a file, then open both in the diff tool.
Maybe you can simplify this to some extent. Configure the scenario you are debugging to write the output to a file (so you won't have to manually save it every time). The debugger will save to the same output file, if you start the debugging session using Debug scenario.
You could use a pattern for the output file of the transformation scenario, so you can use the same pattern for the diff tool.
e.g.

Code: Select all

${cfd}/${cfn}-result.xml
will write the file in the same folder as the source with a name similar to the source, but the suffix "-result.xml"

You can then configure the diffFiles tool as an external tool in Options >Preferences, External Tools. Add a new external tool, give it a name and use the command line:

Code: Select all

"${oxygenInstallDir}/diffFiles" "${cfd}/${cfne}" "/path/to/my/result.xml"
If you've used a pattern for the output file of the transformation scenario, you can use the same pattern here instead of the absolute /path/to/my/result.xml. e.g. "${cfd}/${cfn}-result.xml"
If you'd rather use the keyboard you can assign a shortcut key to the external tool action now.

Last step is to make the external tools toolbar visible in the debugger. Switch to the debugger perspective, right click in the top toolbar area and Configure Toolbars, check the box for Tools.

When you want to run the diff, make sure the focus is in the source file (that's used as the first argument) and use the toolbar to run your custom external tool.

Regards,
Adrian

Re: XSL Debugger: Quickly diff result against source

Posted: Thu Dec 07, 2017 3:13 am
by dcramer
That works. I didn't ever know Debug Scenarios were a thing.

Thanks,
David

Re: XSL Debugger: Quickly diff result against source

Posted: Thu Dec 07, 2017 3:13 am
by dcramer
s/ever/even/