W3C home > Mailing lists > Public > xproc-dev@w3.org > May 2012

Re: Iterating over a list of file paths to run an xslt on each

From: David Cramer <david@thingbag.net>
Date: Tue, 01 May 2012 14:29:47 -0500
Message-ID: <4FA039AB.3010203@thingbag.net>
To: XProc Dev <xproc-dev@w3.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks Jostein and Romain. That did the trick.

David

On 04/30/2012 05:40 PM, Jostein Austvik Jacobsen wrote:
> Use p:load to load documents dynamically. I think I'd do something
> like this... (untested)
> 
> <p:for-each> <p:iteration-source select="//wadl"> <p:pipe
> port="result" step="yourFileList"/> </p:iteration-source> 
> <p:variable name="href" select="/*/@href"/>
> 
> <p:load> <p:with-option name="href" select="$href"/> </p:load>
> 
> <!-- ... do your stuff ... -->
> 
> </p:for-each>
> 
> Jostein
> 
> 
> 2012/5/1 David Cramer <david@thingbag.net
> <mailto:david@thingbag.net>>
> 
> Hi there, In a pipeline [1], I use an xslt to find a list of URIs
> to files which I would like to then process. The list of files
> comes out on the secondary port of the list-files step in the
> format <root><wadl href="file://path/to/file.wadl"/></root> (though
> I could change the xslt if necessary).
> 
> In the p:for-each, I would like to read each of these files,
> process it, and write out the result. I've tried various things
> involving p:document and other combinations, but I suspect I'm
> going about things the wrong way. All my attempts result in a
> XD0016. Can someone point me in the right direction?
> 
> Thanks, David
> 
> [1] http://pastebin.com/qSb6PVie
> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPoDmrAAoJEMHeSXG7afUhT3UH+wQbAXie7Y4CkPaCufrZ5+wL
UIC+zBBbywaOIAXsD8g/JCUq6tnHKAywnb9dz2qVRpoMam/TU/GEJiBnXc2Z1UsO
G56YXZ2l5W+csyWC6HFLZzyMjfuaxIv7vBXHOMCM0T6Gsxpht11+HMJDU8qVRVrd
3qhcdnkoaht73LjtXrfBVWlvXBtKand383EzX9fxU7Amt9pU8d9+I/yZ1tnALSwv
NOOkQsfnxLv2GtZ8yF5BkYcMOzGw5pWVkFW/Hm0VXyPukpooNvbxHo/xpkbzz2UK
fZWDTZPGjT4eYyLTopURmxH5dwF/47L9ysRALrFLqIpSq+ms57gie+SCFcKqqRQ=
=MeLb
-----END PGP SIGNATURE-----
Received on Tuesday, 1 May 2012 19:30:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 1 May 2012 19:30:18 GMT