Note that there are some explanatory texts on larger screens.

plurals
  1. POMerging different complex data using XSLT 1.0 XML
    primarykey
    data
    text
    <pre><code> &lt;?xml version="1.0" encoding="windows-1250"?&gt; &lt;CONTACTS&gt; &lt;CONTACT&gt; &lt;Customer-ID&gt;Cus-ID3&lt;/Customer-ID&gt; &lt;FirstName&gt;Arnaaud&lt;/FirstName&gt; &lt;LastName&gt;Forestier&lt;/LastName&gt; &lt;EMail&gt;Arnaaud_Forestier201111@yahoo.fr&lt;/EMail&gt; &lt;/CONTACT&gt; &lt;CONTACT&gt; &lt;Customer-ID&gt;Cus-ID5&lt;/Customer-ID&gt; &lt;FirstName&gt;Arun_Forestier&lt;/FirstName&gt; &lt;LastName&gt;Forestier&lt;/LastName&gt; &lt;EMail&gt;Arnaaud_Forestier201111@yahoo.fr&lt;/EMail&gt; &lt;EMail&gt;Arnaaud_Forestier201111@gmail.com&lt;/EMail&gt; &lt;/CONTACT&gt; &lt;CONTACT&gt; &lt;Customer-ID&gt;Cus-ID7&lt;/Customer-ID&gt; &lt;FirstName&gt;Aana&lt;/FirstName&gt; &lt;LastName&gt;Edwards&lt;/LastName&gt; &lt;EMail&gt;Aana.edwards@gmail.com&lt;/EMail&gt; &lt;/CONTACT&gt; &lt;CONTACT&gt; &lt;Customer-ID&gt;Cus-ID9&lt;/Customer-ID&gt; &lt;FirstName&gt;Aana_Edwards&lt;/FirstName&gt; &lt;LastName&gt;Edwards&lt;/LastName&gt; &lt;EMail&gt;Aana.edwards@yahoo.com&lt;/EMail&gt; &lt;/CONTACT&gt; &lt;CONTACT&gt; &lt;Customer-ID&gt;Cus-ID11&lt;/Customer-ID&gt; &lt;FirstName&gt;Lina&lt;/FirstName&gt; &lt;LastName&gt;Joseph&lt;/LastName&gt; &lt;EMail&gt;Lina.Joseph@aol.com&lt;/EMail&gt; &lt;/CONTACT&gt; &lt;CONTACT&gt; &lt;Customer-ID&gt;Cus-ID13&lt;/Customer-ID&gt; &lt;FirstName&gt;SandfordFrankie&lt;/FirstName&gt; &lt;LastName&gt;Frankie Sandford/LastName&gt; &lt;EMail&gt;Sandford1233@yahoo.com&lt;/EMail&gt; &lt;URL&gt;http://www.facebook.com/profile.php?id=122112487211054&lt;/URL&gt; &lt;/CONTACT&gt; &lt;CONTACT&gt; &lt;Customer-ID&gt;Cus-ID15&lt;/Customer-ID&gt; &lt;FirstName&gt;Sandford&lt;/FirstName&gt; &lt;LastName&gt;Frankie/LastName&gt; &lt;EMail&gt;Sandford1233@yahoo.com&lt;/EMail&gt; &lt;EMail&gt;Sandford.frankie@gmail.com&lt;/EMail&gt; &lt;/CONTACT&gt; &lt;/CONTACTS&gt; </code></pre> <p>The above XML file has some complex data and this question might look similar to this question. <a href="https://stackoverflow.com/questions/6944514/grouping-and-merging-of-two-contacts-in-xslt1-0">Grouping and merging of two contacts in XSLT1.0</a> According to me this data is entirely different(more complex) from the above question, so i'm creating a new question here.</p> <p>We see the <code>&lt;Customer-ID&gt;Cus-ID3&lt;/Customer-ID&gt; &amp; &lt;Customer-ID&gt;Cus-ID5&lt;/Customer-ID&gt;</code> data belongs to the same person because one of his email addess is same. How can I merge these 2 contacts as a single contact?</p> <p>Another problem, <code>&lt;Customer-ID&gt;Cus-ID7&lt;/Customer-ID&gt; &amp; &lt;Customer-ID&gt;Cus-ID9&lt;/Customer-ID&gt;</code> also belongs to another person. Here she has two different emails but in both the contatcs, the </p> <blockquote> <p>FirstName &amp; LastName are same values. How can I merge these 2 contacts as a single contact?</p> </blockquote> <p>Would it be possible to merge these complex data?</p> <p>I need an output like this using XSLT-1.0</p> <pre><code>&lt;?xml version="1.0" encoding="windows-1250"?&gt; &lt;CONTACTS&gt; &lt;CONTACT&gt; &lt;Customer-ID&gt;Cus-ID5&lt;/Customer-ID&gt; &lt;FirstName&gt;Arun_Forestier&lt;/FirstName&gt; &lt;LastName&gt;Forestier&lt;/LastName&gt; &lt;EMail&gt;Arnaaud_Forestier201111@yahoo.fr&lt;/EMail&gt; &lt;EMail&gt;Arnaaud_Forestier201111@gmail.com&lt;/EMail&gt; &lt;/CONTACT&gt; &lt;CONTACT&gt; &lt;Customer-ID&gt;Cus-ID9&lt;/Customer-ID&gt; &lt;FirstName&gt;Aana_Edwards&lt;/FirstName&gt; &lt;LastName&gt;Edwards&lt;/LastName&gt; &lt;EMail&gt;Aana.edwards@yahoo.com&lt;/EMail&gt; &lt;EMail&gt;Aana.edwards@gmail.com&lt;/EMail&gt; &lt;/CONTACT&gt; &lt;/CONTACTS&gt; </code></pre> <p>Please tell me if there is any flaw in my question. Thank you very much. Note: The email address displayed here are duplicate values.</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