Lists Home |
Date Index |
I'll second the vote for a pull parser approach. I've got a simple pull
parser document comparison implementation as part of my JiBX project
that might serve as a good starting point for this:
(or in the distribution as
build/extras/org/jibx/extras/DocumentComparator.java). If your documents
use ordering doing a merge should be easy.
Dennis M. Sosnoski
Enterprise Java, XML, and Web Services Support - http://www.sosnoski.com
JiBX Lead Developer - http://www.jibx.org
Redmond, WA 425.885.7197
Chris Wilper wrote:
>You might find http://www.alphaworks.ibm.com/tech/xmldiffmerge
>useful. I'm not sure whether it uses SAX or DOM or a combo though.
>Another idea is to abandon DOM and SAX altogether and try a
>pull parser on each of your streams, controlling the merging process
>in a more straightforward way.
>From: Dongling Ding [mailto:firstname.lastname@example.org]
>Sent: Friday, November 21, 2003 10:56 AM
>Subject: [xml-dev] Merge xml documents with SAX
>We're dealing with XML documents merge. The size of
>docs may be big (> 2 mb). The DOM objects really
>consume memory resource here. Is there any to build
>one DOM object and use SAX to access another doc, and
>perform merge process? Is there anyone trying to use
>this kind of approach?
>Any light on this?