Selecting unique elements using XSLT.

Posted by AJ on Stack Overflow See other posts from Stack Overflow or by AJ
Published on 2010-04-28T09:35:03Z Indexed on 2010/04/28 11:03 UTC
Read the original article Hit count: 173

Filed under:
|
|
|

I have the following XML:

<option>
    <title>ABC</title>
    <desc>123</desc>
</option>
<option>
    <title>ABC</title>
    <desc>12345</desc>
</option>
<option>
    <title>ABC</title>
    <desc>123</desc>
</option>
<option>
    <title>EFG</title>
    <desc>123</desc>
</option>
<option>
    <title>EFG</title>
    <desc>456</desc>
</option>

Using XSLT, I want to transform it into:

<choice>
    <title>ABC</title>
    <desc>123</desc>
    <desc>12345</desc>
</choice>
<choice>
    <title>EFG</title>
    <desc>123</desc>
    <desc>456</desc>
</choice>

© Stack Overflow or respective owner

Related posts about xsl

Related posts about xslt