vendredi 18 décembre 2015

Remove Duplicates only if all the Fields have same data

I have a requirement to remove the duplicates only if all my fields have same data in an XML.But the problem here is it is not a List and my field names are also different. for ex:

Scenario:1

<Items>-->Not a List just an generic object Type T
<Name1A>test1</Name1A>
<Book1A>booktest1</Book1A>
<Page1A>pagetest1<Page2A>
<Name2A>test2</Name2A>
<Book2A>booktest2</Book2A>
<Page2A>pagetest2</Page2A>
</Items>

In this case I have to populate all the above fields

Scenario 2:
<Items>-->Not a List just an generic object Type T
<Name1A>test1</Name1A>
<Book1A>booktest1</Book1A>
<Page1A>pagetest1<Page2A>
<Name2A>test1</Name2A>
<Book2A>booktest1</Book2A>
<Page2A>pagetest1</Page2A>
</Items>

In this case I have to populate only <Name1A>,<Book1A>,<Page1A> because in the next set of fields my data is same.

Scenario 3:
<Items>-->Not a List just an generic object Type T
<Name1A>test1</Name1A>
<Book1A>booktest1</Book1A>
<Page1A>pagetest1<Page2A>
<Name2A>test2</Name2A>
<Book2A>booktest1</Book2A>
<Page2A>pagetest1</Page2A>
</Items>

In this case also I would expect to populate all the fields because <Name2A>data is different.

Aucun commentaire:

Enregistrer un commentaire