![]() |
|
|
|||||||
![]() |
XML - Good way to selectively merge XML docs? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hi folks, I'm interested in merging two xml docs together. The documents use the same structure, and in the case of similar nodes I'd like to keep the "newer" one. I'll explain what I mean by that below. For instance, if I have two docs like so: <!--xmldoc1--> <topnode> <automobilepart> <name>Radiator</name> <version>4</version> </automobilepart> <automobilepart> <name>Head Gasket</name> <version>8</version> </automobilepart> </topnode> <!--xmldoc2--> <topnode> <automobilepart> <name>Radiator</name> <version>6</version> <!--note newer version from above--> </automobilepart> <automobilepart> <name>Spark Plug</name> <version>4</version> </automobilepart> </topnode> I'd like to create a document which is a combination of the two inputs, but only has the "latest" version of a given autopart. In the example above, my final document would contain a Head Gasket, a Spark Plug, and a Radiator, whose "version" is 6. How might I tackle this? Could I do it with XSLT? I'm using the MSXML3 parser to create the first two documents, if that helps any. TIA, -Jim Jim Bancroft |
|
|