Note that there are some explanatory texts on larger screens.

plurals
  1. POHelp with XSLT to transform XML: grouping and selecting elements with max value
    primarykey
    data
    text
    <p>I have the current XML:</p> <pre><code>&lt;DocumentElement&gt; &lt;Customer&gt; &lt;CustomerId&gt;2315&lt;/CustomerId&gt; &lt;Date&gt;2011-04-28 14:14:00&lt;/Date&gt; &lt;VersionNumber&gt;1&lt;/VersionNumber&gt; &lt;GUID&gt;2E05DE20-02A0-425D-944D-65E5E744FF8A&lt;/GUID&gt; &lt;/Customer&gt; &lt;Customer&gt; &lt;CustomerId&gt;2316&lt;/CustomerId&gt; &lt;Date&gt;2011-04-28 15:03:00&lt;/Date&gt; &lt;VersionNumber&gt;2&lt;/VersionNumber&gt; &lt;GUID&gt;2E05DE20-02A0-425D-944D-65E5E744FF8A&lt;/GUID&gt; &lt;/Customer&gt; &lt;Customer&gt; &lt;CustomerId&gt;2317&lt;/CustomerId&gt; &lt;Date&gt;2011-04-28 15:03:00&lt;/Date&gt; &lt;VersionNumber&gt;1&lt;/VersionNumber&gt; &lt;GUID&gt;9995DE20-02A0-425D-944D-65E5E744FF8A&lt;/GUID&gt; &lt;/Customer&gt; &lt;/DocumentElement&gt; </code></pre> <p>What I am trying to do is to filter out one element of each GUID with the highest version number, i.e, transform the document above to look like:</p> <pre><code>&lt;DocumentElement&gt; &lt;Customer&gt; &lt;CustomerId&gt;2316&lt;/CustomerId&gt; &lt;Date&gt;2011-04-28 15:03:00&lt;/Date&gt; &lt;VersionNumber&gt;2&lt;/VersionNumber&gt; &lt;GUID&gt;2E05DE20-02A0-425D-944D-65E5E744FF8A&lt;/GUID&gt; &lt;/Customer&gt; &lt;Customer&gt; &lt;CustomerId&gt;2317&lt;/CustomerId&gt; &lt;Date&gt;2011-04-28 15:03:00&lt;/Date&gt; &lt;VersionNumber&gt;1&lt;/VersionNumber&gt; &lt;GUID&gt;9995DE20-02A0-425D-944D-65E5E744FF8A&lt;/GUID&gt; &lt;/Customer&gt; &lt;/DocumentElement&gt; </code></pre> <p>Anyone who can point me in the right direction on where to start?</p> <p>Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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