Compare & Merge XML documents

M

Michael Ransburg

Hello!

Is there some library for comparing & merging XML documents? I want it
to do something like that:

Base document:
<office>
<desk color="brown" height=50></desk>
</office>

Update document:
<office>
<desk length=30 height=30></desk>
<chair height=5></chair>
</office>

Result:
<office>
<desk color="brown" height=30 length=30></desk>
<chair height=5></chair>
</office>


So, if the update document contains an element/attribute which the
base document does not contain, it is added.
If the update document contains the same element/attribute with
another value, the base document's value is overwritten.

I would prefer a java library / open source tool for this.

Does anyone know of an implementation for this functionality? If there
is no such thing, I'll have to do it on my own, using either a SAX
parser or XSLT I guess...

Any input ist really appreciated!

cheers
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top