Re: [xsl] Merging two documents

Subject: Re: [xsl] Merging two documents
From: Martin Renner <m.renner@xxxxxxxxxx>
Date: Tue, 10 Apr 2001 10:47:12 +0159
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



Current Thread