[xsd-users] Need help: how to merge multiple xml files

Boris Kolpackov boris at codesynthesis.com
Fri Oct 8 10:49:02 EDT 2010


Hi,

JW <jianwei.z at gmail.com> writes:

> I have been reading the manuals and wiki but could not find a solution for
> this kind of merging.

There is no way to automatically merge two object models. The process is
not well defined (i.e., are the new values added at the beginning or at
the end, at what depth in the tree, what happens to duplicates, etc.,
etc).

Perhaps if there is some regularity in your XML documents, then some
schema-specific merging can be done. For example, if your document has 
the following structure:

<position>
  <measure x="1.1", y="2.1"/>
  <measure x="1.0", y="2.1"/>
  <measure x="1.1", y="2.0"/>
</position>

Then it should be easy to come up with a simple merge algorithm. Can you
tell us more about your document structure? Maybe also show some examples
of the merges that you want to achieve.

Boris



More information about the xsd-users mailing list