Page 1 of 1

Working directory for Transformation Scenario

Posted: Mon Jul 31, 2006 12:08 pm
by borisb
Hello,
I am writing some XSLT 2.0 transforms that reference local files and generate multiple output documents. Before, when invoking Saxon from command line, I was using paths relative to the directory where I ran the processor. The advantage of having a working directory and not using absolute paths is that your stylesheets can be executed without change on both Unix and Windows systems.

Would it be possible to add a working directory setting for Transformation Scenarios, so that the directory paths used in XSLT are relative to the directory you configure?

Best regards,
Boris

Posted: Mon Jul 31, 2006 12:37 pm
by sorin_ristache
Hello,

The transformation scenario does not restrict you to absolute paths. A relative path in the scenario specified for the input file, the output file or for an additional XSLT stylesheet is resolved relative to the URL of the document to which the scenario is associated, that is the currently edited document when the scenario is executed. This possibility to use relative paths together with the macros available from the Insert macros button present for many fields of the scenario make the scenario independent of the location of the document associated with the scenario. This enables you to export the scenario on one platform/computer, import it on another one and execute it without any change to the scenario parameters.

Relative paths in the XSLT stylesheet itself are resolved relative to the base URI of the element containing the relative path. This is required by the XSLT specification. Usually that base URI is the URI of the stylesheet.

Regards,
Sorin

Posted: Mon Jul 31, 2006 7:25 pm
by borisb
Thanks for the clarification. I guess that my problem is then related only to the Saxon extension classes I wrote. These functions access files on disk, and they did so with relative paths (I implicitly expected them to be relative to the document I am transforming).

Regards,
Boris