Hi,

Other ways is to use the xinclude transformer (you can generate dynamically the 
xincludes), or use the XSLT document function.  I have tried these methods, and all of 
them work ok.

-----Mensaje original-----
De: Tony Edwards [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 30 de abril de 2004 6:22
Para: [EMAIL PROTECTED]
Asunto: Re: Best way to merge two xml files



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"
src="webdav://localhost:8080/slide/files/xml/{request-param:fileName}"
label="src"/>

<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:transform>                 
<map:serialize type="fo2pdf"/>
</map:when>

You'll note there's a cinclude level for subordinate level of documentation.
Works like a charm!
Hope this helps.
Tony
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


*************************************************************
Este correo ha sido procesado por el antivirus del Grupo FCC.
*************************************************************

*************************************************************
Este correo ha sido procesado por el antivirus del Grupo FCC.
*************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to