Directories in XProc

Hi,

I'm trying to implement a pipeline that wraps each file in a given directory in a wrapper document, which will then be processed further.

The pipeline below is (apart from the directory name and the name of the wrapper node) a verbatim copy from Martin Kraetkes xproc3-tutorial. If I put this in the top-level directory of the project, I can call it like this:
Morgana.bat merger.xpl -output:result=wrapper-xml/result.xml
-> this works

But, if I put it in a subdir "_assets", it does not work anymore:
Morgana.bat _assets/merger.xpl -output:result=wrapper-xml/result.xml

I'm getting an error telling me that the directory "_assets/temp-html" does not exist. Apparently, the path is relative to where the pipeline is, but I'd obviously would want to resolve paths relative to where the pipeline is called. Is there a way to do this or do I have to make this explicit in the pipeline?

Best,
Denis

<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
    xmlns:c="http://www.w3.org/ns/xproc-step"
    version="3.0">

    <p:output port="result"/>

    <p:option name="chapter-dir" select="'temp-html'"/>

    <p:directory-list path="{$chapter-dir}"/>

    <p:for-each>
        <p:with-input select="//c:file"/>

        <p:load href="{$chapter-dir || '/' || c:file/@name}"/>

    </p:for-each>

    <p:wrap-sequence wrapper="docs-wrapper"/>

</p:declare-step>

Received on Tuesday, 19 November 2024 10:04:10 UTC