Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to merge two nodes having "the same father" and having a precise "method" sequence (using XSLT)?
    primarykey
    data
    text
    <p>I need to merge the two nodes MANHATTAN:</p> <p>because our system rule is the following:</p> <p>"<strong>CREATE</strong> A + <strong>MODIFY</strong> A" is still a "<strong>CREATE</strong> A with the merged attributes"</p> <p>input file:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;world&gt; &lt;COUNTRY id="USA" &gt; &lt;STATE id="NEW JERSEY"&gt; &lt;CITY id="NEW YORK" method="modify"&gt; &lt;DISTRICT id="MANHATTAN" method="create"&gt; &lt;attributes&gt; &lt;population&gt;99 &lt;/population&gt; &lt;income&gt; 10000&lt;/income&gt; &lt;/attributes&gt; &lt;/DISTRICT&gt; &lt;DISTRICT id="MANHATTAN" method="modify"&gt; &lt;attributes&gt; &lt;temperature&gt;78&lt;/temperature&gt; &lt;income&gt;15000&lt;/income&gt; &lt;information&gt;suburb of newyork&lt;/information&gt; &lt;/attributes&gt; &lt;/DISTRICT&gt; &lt;/CITY&gt; &lt;/STATE&gt; </code></pre> <p> </p> <p>Expected output:</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;world&gt; &lt;COUNTRY id="USA" &gt; &lt;STATE id="NEW JERSEY"&gt; &lt;CITY id="NEW YORK" method="modify"&gt; &lt;DISTRICT id="MANHATTAN" method="create"&gt; &lt;attributes&gt; &lt;population&gt;99 &lt;/population&gt; &lt;temperature&gt;78&lt;/temperature&gt; &lt;income&gt;15000&lt;/income&gt; &lt;information&gt;suburb of newyork&lt;/information&gt; &lt;/attributes&gt; &lt;/DISTRICT&gt; &lt;/CITY&gt; &lt;/STATE&gt; &lt;/COUNTRY&gt; &lt;/world&gt; </code></pre> <p>Please help, I have just began XSLT and doing it in Perl or Python will takes hours.</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