Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Getting distinct values

From: "chris fellows" <chrisfellows@------.--.-->
To: NULL
Date: 3/29/2008 12:19:00 PM

I need some help to transform some XML that is derived from a recordset 
where each record is a Record element. My output XML needs to have one 
Record element for each distinct Id value and within this element I want a 
ColValuesA element that contains a distinct list of all ColA values and a 
ColValuesB element that contains a distinct list of all ColB values.

Recordset used to generate Input XML:

Id    ColA    ColB
1    A1        B1
1    A1        B2
1    A1        B3
1    A2        B1
1    A2        B2
1    A2        B3
2 ...more data...


Input XML:
<Root>
    <Record Id="1">
        <ColA>A1</ColA>
        <ColB>B1</ColB>
    </Record>
 ...and repeated for each record...
</Root>


Output XML required:
<Transformed>
    <Record Id="1">
        <ColValuesA>
            <ColA>A1</ColA>
            <ColA>A2</ColA>
        </ColValuesA>
        <ColValuesB>
            <ColB>B1</ColB>
            <ColB>B2</ColB>
            <ColB>B3</ColB>
        </ColValuesB>
 </Record>
 <Record Id="2">
    ...more...
 </Record>
</Transformed> 




transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent