xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Boag/CAM/Lotus" <Scott_B...@lotus.com>
Subject Re: Merge multiple XML Docs into one XML Doc
Date Tue, 25 Jan 2000 18:30:11 GMT

Just use xsl:copy-of in XSLT.   <xsl:copy-of select="document
('http://foo.com/blah.xml')/*"/>  should copy the document element &
children of blah.xml to the result tree.


                    Brian Dupras                                                         
                    <briand@cente        To:     "Xml-Apache (E-mail)" <general@xml.apache.org>
                    ra.com>              cc:     (bcc: Scott Boag/CAM/Lotus)          
                                         Subject:     Merge multiple XML Docs into one XML
                    01:16 PM                                                             
                    respond to                                                           

OK - this should be an easy one, but so far I've yet to find a definitive

I have a system where I'm given multiple XML DOM Documents that I need to
process and merge into a single DOM Document.  The known portions of the
input Documents get processed, while the unknown portions need to be copied
over directly.

The question is, how do I properly insert entire nodes (and their
from one document to another?  Do I have to write my own recursive copy

I'm free to use either the DOM functions, or XSLT.


Given as DOM Documents:
                               <replaceme id="a"/>

                               <replaceme id="b">
                               <inserthere thexml="doc1">

                     <inserthere thexml="doc1">

Created from scratch:
                               <replaced>doc2 id b</replaced>
                                          <replaced>doc1 id a</replaced>

Brian Dupras
Centera Information Systems, Inc.
phone           303.939.0200 x294
fax        303.939.0111
web        http://www.centera.com
email           briand@centera.com

View raw message