I have hundreds of xml files. I have function to compare 2 xml tree and return true if they are identical. each xml tree have unique id number which is ignored in the comparison.
now I want to iterate over all the xml files, compare them and save the trees in a data structure like dictionary. but python not allowing me to save tree as a key and its id as a value. is there a way to have a dictionary of tree as key? if not then what type of data structure could be used for this?
example:
Note that Tree1 = Tree2 but != Tree3 (ignoring the id) So I want my dic or any data structure to be like:
dic = {Tree1:[I1.i1.p1.m1, I1.i1.p1.m2], Tree3: [I1.i1.p1.m3]}
Thanks
No comments:
Post a Comment