You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter van Hardenberg <pv...@uvic.ca> on 2005/07/20 17:27:28 UTC

Data-driven decorator design

Hi all,

I'd like to "decorate" my XML files as an early processing step with XML from 
another source. The source documents are Shakespearean texts, and I want to 
use Cocoon to overlay annotations from various sources onto the file.

I am considering using map:aggregate, but it seems needlessly ugly to have to 
say something like this in every match:

<map:aggregate>
   <my old source>
   <my annotation file>
</map:aggregate>
<map:transform purpose="move the annotation file into the source and unwrap 
the new root node"/>
...

Does anyone have any advice about a Better Way? I am considering using the 
same approach I currently use to create templates. Start with a simple XSLT, 
XInclude the data for that request into it, then use a the cocoon:/ protocol 
transform step to interleave the two. That would let me move the whole ugly 
mess into a single line in each match rule and any messiness could be 
contained in an internal pipeline.

All the best,

-pvh

-- 
Peter van Hardenberg (pvh@pvh.ca)
Victoria, BC, Canada