cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robby Pelssers <>
Subject zip-archive generator (reverse of zip-archive serializer)
Date Fri, 07 Dec 2012 11:55:39 GMT
Hi guys,

Not sure if we have a zip-archive generator already

but it would be very cool to have one.  Let me explain the use case:

   {1}: a URI pointing to a zip containing XML documents
<map:match pattern="processzip/**">
  <map:generate src="{1}" type="zip"/>
  <map:transform src="processfiles.xslt"/>
   Now a lot of options
    - write results to disk 
    - just serialize result
    - zip transformed files again

So what should this ziparchive generator do?  It should let us peak into the ziparchive and
return URI's for all entries

<zip:archive xmlns:zip="">
  <zip:entry name="jar:file:/C:/data/!/products/PH3330L.xml"/>
  <zip:entry name="jar:file:/C:/data/!/packages/SOT669.xml"/>


<zip:archive xmlns:zip="">
  <zip:entry name="jar:!/products/PH3330L.xml"/>
  <zip:entry name="jar:!/packages/SOT669.xml

So if you add a transformer in that pipeline you can use the XSLT document function to fetch
the documents and process them individually.

I'm only not sure about how to implement this efficiently. I  don't want to make requests
in case of a HTTP URI:
- 1 used by the ziparchive-generator to produce the XML above
- 1 request per invocation of the document function

So maybe caching can resolve this or are there better options?

View raw message