Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to Merge two xml files with XSLT
    primarykey
    data
    text
    <p>I have two xml files which need to be merged into one by using XSLT. </p> <p>First XML is (the original one): </p> <pre><code>&lt;feed&gt; &lt;author&gt; &lt;firstName&gt;f&lt;/firstName&gt; &lt;lastName&gt;l&lt;/lastName&gt; &lt;/author&gt; &lt;date&gt;2011-01-02 &lt;/date&gt; &lt;entry&gt; &lt;id&gt;1&lt;/id&gt; &lt;Name&gt;aaa&lt;/Name&gt; &lt;Content&gt;XXX&lt;/Content&gt; &lt;/entry&gt; &lt;entry&gt; &lt;id&gt;2&lt;/id&gt; &lt;Name&gt;bbb&lt;/Name&gt; &lt;Content&gt;YYY&lt;/Content&gt; &lt;/entry&gt; &lt;/feed&gt; </code></pre> <p>Second XML(updated data) is like this:</p> <pre><code> &lt;feed&gt; &lt;author&gt; &lt;firstName&gt;f&lt;/firstName&gt; &lt;lastName&gt;l&lt;/lastName&gt; &lt;/author&gt; &lt;date&gt;2012-05-02 &lt;/date&gt; &lt;entry&gt; &lt;id&gt;2&lt;/id&gt; &lt;Name&gt;newName&lt;/Name&gt; &lt;Content&gt;newContent&lt;/Content&gt; &lt;/entry&gt; &lt;entry&gt; &lt;id&gt;3&lt;/id&gt; &lt;Name&gt;ccc&lt;/Name&gt; &lt;Content&gt;ZZZ&lt;/Content&gt; &lt;/entry&gt; &lt;/feed&gt; </code></pre> <p>The desired merged result - using the second XML to update the first one :</p> <pre><code> &lt;feed&gt; &lt;author&gt; &lt;firstName&gt;f&lt;/firstName&gt; &lt;lastName&gt;l&lt;/lastName&gt; &lt;/author&gt; &lt;date&gt;2012-05-02 &lt;/date&gt; &lt;entry&gt; &lt;id&gt;1&lt;/id&gt; &lt;Name&gt;aaa&lt;/Name&gt; &lt;Content&gt;XXX&lt;/Content&gt; &lt;/entry&gt; &lt;entry&gt; &lt;id&gt;2&lt;/id&gt; &lt;Name&gt;newName&lt;/Name&gt; &lt;Content&gt;newContent&lt;/Content&gt; &lt;/entry&gt; &lt;entry&gt; &lt;id&gt;3&lt;/id&gt; &lt;Name&gt;ccc&lt;/Name&gt; &lt;Content&gt;ZZZ&lt;/Content&gt; &lt;/entry&gt; &lt;/feed&gt; </code></pre> <p>I have searched stackoverflow but still could not find the answer. Thanks for help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload