cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Edwards <>
Subject Re: Best way to merge two xml files
Date Fri, 30 Apr 2004 04:21:42 GMT
Hi David,
Check out cinclude.
We have a documentation application that combines documents from 
multiple sources.
Eg we have a primary, high level description document that can reference 
any number of subordinate process description documents. Each of these 
process descriptions can reference any number of module level 
description documents which themselves can reference step level 
documents. We throw the whole lot together using cinclude.
Our relevent sitemap chunk looks like this:

<map:when test="pdf">                    
<map:generate type="file" 

<map:transform src="xsl/cinclude_identity_featureLink.xsl" label="cinc1" />
<map:transform type="cinclude"/>                                      
<map:transform src="xsl/cinclude_identity_featureLink.xsl" label="cinc2" />
<map:transform type="cinclude"/>               

<map:transform src="xsl/cinclude_identity_featureLink.xsl" label="cinc3" />
<map:transform type="cinclude"/>                           
<map:transform src="xsl/modManualFO.xsl" label="fop"/>
<!-- This stylesheet makes image URLs absolute, so that FOP can
display images. {realpath:/} returns the absolute path of the
context root.-->
<map:transform src="xsl/fix-imagelinks.xsl" label="debug2">
<map:parameter name="ctxroot" value="{realpath:/}"/>
<map:parameter name="dir" value="/civica_help/images/"/>
<map:serialize type="fo2pdf"/>

You'll note there's a cinclude level for subordinate level of documentation.
Works like a charm!
Hope this helps.
David Swearingen wrote:

> (Subject line of my post may be misleading.)  What I'm trying to do 
> is, when XSL processing of foo.xml is taking place, when a certain 
> element is encountered in foo.xml, I want to insert content from 
> someotherdocument.xml. 
> It appears that the XSLT function document() does this.  Is this the 
> best way? 
> [I realize that aggregate sounds like it should do the trick, however, 
> aggregate appears to require a priori knowledge of how many documents 
> to aggregate, that is, when creating the sitemap you have to know in 
> advance that you're going to do n aggregations.  In my case, however, 
> I don't know how often I'm going to have to merge other xml documents 
> when processing the main document.]
> Hope that made sense.
> David

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message