Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Merge/Synchronize XML Files

From: "Anthony Jones" <Ant@------------.--->
To: NULL
Date: 11/3/2006 1:07:00 PM


"Meelis Lilbok" <meelis.lilbok@d...> wrote in message
news:uvG8V2z$GHA.2328@T......
> Hi is for synchronizing two xml files any fast solution?
>
> Lets say i have 2 xml files 1.xml and 2.xml
>
> 1.xml contianes
>
> <test>
>     <t id="1">Hello</t>
>     <t id="2">World</t>
>     <t id="3">Good bye!</td>
> </test>
>
> 2.xml containes
> <test>
>     <t id="1">Hello</t>
>     <t id="2">World</t>
> </test>
>
> After synchronizing 2.xml must look likt this
> <test>
>     <t id="1">Hello</t>
>     <t id="2">World</t>
>     <t id="3">Good bye!</td>
> </test>
>
> At the moment i use
>     For Each
>     Next
> and this is too slow, if file containes  about 1000 <t> nodes
>
> Regards;
> Meelis
>

I suspect that a loop using .nextNode on either the input, target or both
per iteration will suit your needs   Although XSL may still outperform a
script based language doing this even 1000 nodes shouldn't take an excessive
amount of time.

Your example doesn't show why you simply don't replace 2.xml with 1.xml.
More detail show the wider set of cases are needed to arrive at an
apporpriate solution.

If id="1" were missing from 1.XML should it be deleted from 2.xml?
If id="2" in 2.xml contained the word 'kosmos' should it contain 'world'
after the merge because it was replaced by id="2" from 1.xml?
In the real world is t a complex element if so do you intend to merge the
contents of ts of the same id from each xml file or simply replace the t in
2.xml with the one in 1.xml?








transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent