Altova Mailing List Archives

Re: [xsl] merging documents/union

From: Trevor Nash <tcn@------------->
Date: 12/15/2001 4:40:00 AM
>I need to write a special kind of "union" template that merges two nodesets.
>The structure of these nodesets is not known.
>For example those two <node> elements should be merged to one <node> where
>second overwrites the first:

Have you looked at

Its not exactly what you want, but might be a good place to start.

There is also a thread in the archive about inheritance, again not
exactly what you want, but might give you some ideas:

The key to success is being very clear what you mean by 'merge'.  You
mention that if the 'same' element occurs in both node-sets then one
takes precendence over the other: but is sameness based on just the
element name, or do attribute values count too?  Are the documents
ordered?  Is the process recursive (if the 'same' element occurs with
children, you might want to merge the children rather than take just
one set).

Trevor Nash
Traditional training & distance learning,
Consultancy by email

Melvaig Software Engineering Limited
voice:     +44 (0) 1445 771 271 
email:     tcn@xxxxxxxxxxxxx

 XSL-List info and archive:


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 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.