sequence of filtered documents as input of p:xslt

Hi all,

Continuing discovering xproc, I have a new problem today :

One of the steps of my pipeline gives for result an XHTML document that 
contains many
<object data="fileA.svg">, <object data="fileB.svg"> elements.

Of course each referenced "file{?}.svg" exists in a specific directory, 
let's call it "SVGdir".

I'd like to iterate on those file{?}.svg and apply an XSLT 
transformation to each one (and store the result in separate directoty).

I don't want to iterate the "SVGdir" directly cause it can contains some 
svg files which I don't want to transform cause they are not referenced 
in the XHTML document.

I think there are 2 options :
- filtering the directory files according to the XHTML
- starting from the XHTML to iterate on the good SVG files in the directory
I thought the 2nd option is better.

(remind : I don't want the XSLT to be applied on the XHTML document 
itself, cause I'd like it to be independant : it takes one SVG in input 
and get one SVG in output.)

The spec says that <p:xslt> can have a sequence of documents as input.
But I don't find a way to make that work :
- should I give an xpath collection() for p:xslt/p:input/@select => 
xproc error
- should I iterate the <object> elements within the XHTML doc and then 
getting the svg document as input :
<p:for-each name="for-each-html-object">
<p:iteration-source select="//h:object">
<p:pipe step="generateECF" port="result"/>
</p:iteration-source>
<p:xslt name="PDFTronSVG2epubFixedSVG">
<p:input port="source" select="document(concat('PAGES_SVG_0', 
tokenize(@data,'/')[last()] ))">
<p:pipe step="for-each-html-object" port="current"/>
</p:input>
           [...]
</p:for-each>
=> xproc err:XD0023:Invalid XPath expression

I will continue to investigate for other solutions, but if you have any 
advices, they are welcome !

Kind Regards,

Matthieu.

-- 
Matthieu Ricaud
IGS-CP
Service Livre numérique

Received on Thursday, 13 October 2011 11:32:09 UTC