Skip to Content
0
Former Member
Jan 11, 2008 at 09:53 PM

Sort the Nodes and remove duplicate nodes

188 Views

Hello Experts,

I have a requirement to sort the nodes based on a key value.

e.g.

<Node>

<Key>2<Key>

<Value1>name1<Value1>

<Value2>email1<Value2>

</Node>

<Node>

<Key>1<Key>

<Value1>name2<Value1>

<Value2>email2<Value2>

</Node>

<Node>

<Key>2<Key>

<Value1>name3<Value1>

<Value2>email3<Value2>

</Node>

and the Output should be

<TNode>

<Key>1<Key>

<Value1>name2<Value1>

<Value2>email2<Value2>

</TNode>

<TNode>

<Key>2<Key>

<Value1>name3<Value1>

<Value2>email3<Value2>

</TNode>

I tried using SortByKey function for Node i.e.

Key --> SortByKey , Node --> TNode

But I dont get sorted value for Value1 and Value2.

Can anybody give solution for this?

I have around 25000 records as input and there are around 25 values in structure.

Please help.

Thanks in advance,

Beena.