FW: Multiple XSLT Steps with Secondary Outputs

Again, meant for the list -

From: Piez, Wendell A. (Fed)
Sent: Thursday, January 23, 2025 9:29 AM
To: Don Smith <dsmith_lockesmith@yahoo.com>
Subject: RE: Multiple XSLT Steps with Secondary Outputs

Don,

Fishing here in the dark a little bit, but I am thinking you do not need three p:for-each. You need something more like

. xslt creates documents on secondary port
. for-each iterates over the sequence, for each
    - It stores it (while passing document along)
    - it transforms it using another xslt (each one separately)
    - it stores this (while passing document along

This assumes your second XSLT works on your documents one by one, not as a set. If the latter, the configuration would depend on how the XSLT is built to accept that sequence.

But if it's as simple as the above, you don't need more than one for-each.

HTH! Wendell

From: Don Smith <dsmith_lockesmith@yahoo.com<mailto:dsmith_lockesmith@yahoo.com>>
Sent: Wednesday, January 22, 2025 9:21 PM
To: xproc-dev@w3.org<mailto:xproc-dev@w3.org>
Subject: Multiple XSLT Steps with Secondary Outputs

I'm unable to understand how the connections should work between multiple xslt steps where each one has secondary output (and so all but the first have a sequence for an input).

XProc Ref has an example pipeline in the p:xslt step documentation that I'll expand for discussion: https://xprocref.org/3.0/p.xslt.html

My expansion of the pipeline consists in adding a second XSLT step that follows the first and takes as input the sequence of documents output by the first XSLT step (on secondary port). Both XSLT steps should have their sequence outputs written to disk by p:store.  Here's my expansion of the example (minus the XSLT modules that are referenced):

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0">

    <p:input port="source"/>
    <p:output port="result" />

    <p:xslt name="create-secondary-documents-1">
        <p:with-input port="stylesheet" href="spec-split-docs-1.xsl"/>
    </p:xslt>

    <p:for-each name="step1-store">
        <p:with-input pipe="secondary@create-secondary-documents-1"/>
        <p:store href="{base-uri(/)}"/>
        <p:identity>
            <p:with-input pipe="result-uri"/>
        </p:identity>
    </p:for-each>

    <p:for-each>
        <p:xslt name="create-secondary-documents-2">
            <p:with-input port="source" pipe="secondary@create-secondary-documents-1"/>
            <p:with-input port="stylesheet" href="spec-split-docs-2.xsl"/>
        </p:xslt>
    </p:for-each>

    <p:for-each name="step2-store">
        <p:with-input pipe="secondary@create-secondary-documents-2"/>
        <p:store href="{base-uri(/)}"/>
        <p:identity>
            <p:with-input pipe="result-uri"/>
        </p:identity>
    </p:for-each>

</p:declare-step>

I've tried every permutation of this I can think of and I can't get any of them to work. I'm sure that I'm missing something fundamental about connections but am not seeing it. Maybe I've got the pipeline concept entirely wrong for the requirement. In any case am asking for folks to enlighten me.

Thanks,

Don

Received on Thursday, 23 January 2025 15:03:20 UTC