Forcing sequencing in XProc when a p:for-each only has side effects?
04:33 28 Dec 2025

I’m using XProc 3.0 with XML Calabash 3. I have a pipeline where:

  1. I iterate over a directory of XML files
  2. For each file, I run an XSLT trasnformation and store a modified version back to disk
  3. After that, I run p:xinclude on a different document which depends on the files that were fixed and stored in step (2)

    
    
    
    
    
        
        
        
        
        
        
        
            
        
        
    

    
        
            
        
    


The problem: Calabash lets p:xinclude start before the p:for-each has finished writing files, leading to missing-file errors in p:xinclude. I understand why this happens (no data dependency, the loop does not feed any data into the later step so its p:store steps look like side effects), but I can't figure out an idiomatic XProc 3 solution for this.

The question: How can I make sure that all the iterations of p:for-each complete, including all thep:store operations, before running a later step (p:xinclude) when there is no natural document flow between them?

Many thanks in advance!

xml xslt xproc