This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Merging two documents


Hi.

> or what, exactly? "Merge" can mean a dozen different things.

Okay, here a concrete example:

file1.xml
<root>
   <section1>
     <elem>
       <name>1</name>
       <some-stuff>true</some-stuff>
       <other-stuff>
         <nested>true</nested>
       </other-stuff>
     </elem>
   </section1>
</root>

file2.xml
<root>
   <section1>
     <elem>
       <name>3</name>
       <some-stuff>false</some-stuff>
     </elem>
   </section1>
</root>

The "merged" result should be:

<root>
   <section1>
     <!-- all "elem"s from file1 -->
     <elem>
       <name>1</name>
       <some-stuff>true</some-stuff>
       <other-stuff>
         <nested>true</nested>
       </other-stuff>
     </elem>

     <!-- all "elem"s from file2 -->
     <elem>
       <name>3</name>
       <some-stuff>false</some-stuff>
     </elem>

   </section1>
</root>

It's a simple copy&paste: "copy file2/section1/* into file1/section1", "copy 
file2/section2/* into file1/section2".

I hope, that this makes things more clear.


Martin


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]