I have an XProc script that currently hardcodes document hrefs like this:
<p:xslt>
<p:input port="source"/>
<p:input port="stylesheet">
<p:document href="/path/to/stylesheet.xsl"/>
</p:input>
</p:xslt>
I would like to pass /path/to/stylesheet.xsl
as an option to the xproc script, so in my declare-step I put:
<p:option name="stylePath" required="true"/>
but I still can't figure out how to replace the hardcoded href in p:document
with the option value.
I'll be most grateful for your help.
Here's what eventually worked for me:
Create a step to load the document with the option passed to it:
Then, in the XSLT step, pipe the loaded stylesheet
With this setup, one can pass the
stylePath
option when invoking the XProc script without having to hard code the path.