How to compare XML tags of the same XML file in python?



I have XML file as below:



<root>
<sim1>
<latitude>23.1266113 </latitude>
<longitude>72.547799</longitude>
<gsmcellid>7213<gsmcellid>
</sim1>

<sim1>
<latitude>23.1266113 </latitude>
<longitude>72.547799</longitude>
<gsmcellid>7213<gsmcellid>
</sim1>
.
.
.
.
</root>


As per my project requirement I have many nodes like of sim1.Now I want to compare every block of sim1 node with other block and if they are same then want to remove one of them .As shown in code two are same then want to remove one of them.


please help me regarding this.


No comments:

Post a Comment