Hi,
For a free solution :
http://freshmeat.net/projects/libxmldiff/
The outputted diff is a simple merge with "diff:status attributes" ; so
if you are only interested in merging files, you only have to delete the
diff:status attribute by "delete //@diff:status"
Hth,
--
Rémi Peyronnet
fischer@sofika.de a écrit :[color=blue]
> You can merge xml-files with the toolbox <xml>cmp
> (
http://www.xmlcmp.com).
> <xml>cmp is desigend for merging, comparing, sorting and regrouping
> large files by low memory consumption.
>
>
>
>
> Andy Dingley <dingbat@codesmiths.com> wrote:[color=green]
>>
ilikesluts@gmail.com wrote:
>>[color=darkred]
>>> Would it be possible to write an algorithm that takes in two XML
>>> documents[/color]
>> Yes.
>>
>> The next question is what "merge" means. Simple concatenation?
>> Immediate root-children sorted by some definable key? What happens if
>> there's a "duplicate" element, and how might you define duplicate?
>>
>> For grinding data files by hand, I generally use XSLT and XPath. This
>> works fine for one-off hacks with smaller documents. If I started to
>> care about algorithms and performance I might look at programs that ran
>> over the DOM, or even something using SAX (if they were huge documents
>> with simple merges)
>>
>> Algorithms from the '60s (read Knuth !) start to look interesting
>> again, when you're dealing with merge-sorts on datasets to big to hold
>> in memory (i.e. DOM) simultaneously.[/color]
>[/color]