I’m looking for a concrete example of an XSL stylesheet storing the current working directory into a variable.
I need this because in my situation, I need to import certain library stylesheets using a relative path. Knowing the path my processor is choosing as the current directory would be sufficient.
EDIT
Nothing vendor specific please.
In XSLT 2.0 one can use the standard XPath 2.0 function resolve-uri().
Do note, that the relative URIs of the included/imported stylesheet modules are relative to the base URI of the including/importing stylesheet module — not from the “working directory”!
Here is part of the description of this function from the W3 F&O specification:
Here is a very simple example:
when this transformation is applied against any xml document (not used), the result is:
This is the correct result, because our main stylesheet module is saved as: