while parent.get('id', None) != 'book-text':
cparent = copy.deepcopy(parent)
cparent.text = None
+ if 'id' in cparent.attrib:
+ del cparent.attrib['id']
parents.append(cparent)
parent = parent.getparent()
)
else:
for fragment_id in open_fragments:
+ celem = copy.copy(element)
+ if 'id' in celem.attrib:
+ del celem.attrib['id']
open_fragments[fragment_id].append(
- event, copy.copy(element)
+ event, celem
)
return closed_fragments, open_fragments