Merge XML files

  • Thread starter Thread starter MAF
  • Start date Start date
M

MAF

Is there a quick way to merge two XML files

example A
<TestNode>
<Data>123</Data>
</TestNode>

<TestNode>
<Data>123</Data>
<Data>222</Data>
<Data>333</Data>
</TestNode>
<Next Data>
"Hello World"
</Next Data>
Result would be


<TestNode>
<Data>222</Data>
<Data>333</Data>
</TestNode>
<Next Data>
"Hello World"
</Next Data>
 
MAF said:
Is there a quick way to merge two XML files

example A

<snip>

That doesn't look like merging to me - that looks like finding the
difference. Merging would be taking the first bit and the last bit and
the result being the middle bit, in my view.

I've written a bit of xml-diff type code before - and you need to be
*absolutely* sure of *exactly* what the behaviour should be before
starting to code it. It's all too easy to write imprecise
specifications and then get unexpected results :(
(That's just from hard experience, not any judgement of your ability, I
hasten to add.)
 
MAF,
In addition to Jon's comment about that looking like a DIFF operation, not a
merge operation.

Got Dot Net has a "Microsoft XML Diff and Patch" tool plus a handful of
other XML tools available at:

http://www.gotdotnet.com/team/xmltools/

Hope this helps
Jay
 
Back
Top