diff --git a/pygraphml/graphml_parser.py b/pygraphml/graphml_parser.py index bca02be..0ff2b47 100644 --- a/pygraphml/graphml_parser.py +++ b/pygraphml/graphml_parser.py @@ -157,6 +157,9 @@ def parse(self, fname): # source/target attributes refer to IDs: http://graphml.graphdrawing.org/xmlns/1.1/graphml-structure.xsd e = g.add_edge_by_id(source, dest) + + # keep the id of the parsed dom + e.id = edge.getAttribute('id') for attr in edge.getElementsByTagName("data"): if attr.firstChild: