Skip to content

Commit

Permalink
Merge pull request #54 from fsteggink/bgtcrashfix
Browse files Browse the repository at this point in the history
Fix for NLExtract crash (BGT load)
  • Loading branch information
justb4 committed Dec 17, 2016
2 parents 3415ed3 + 4de15de commit 196158f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions stetl/filters/xmlelementreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#
# Author: Frank Steggink
#
from copy import deepcopy

from stetl.component import Config
from stetl.filter import Filter
from stetl.util import Util, etree
Expand Down Expand Up @@ -110,16 +112,10 @@ def process_xml(self, packet):

if tag in self.element_tags:
if event == "start":
# TODO check if deepcopy is the right thing to do here.
# packet.data = elem
pass
# self.root.remove(elem)
elif event == "end":
# Delete the element from the tree
# self.root.clear()
packet.data = elem
packet.data = deepcopy(elem)
self.elem_count += 1
self.root.remove(elem)

if self.strip_namespaces:
packet.data = Util.stripNamespaces(elem).getroot()
Expand Down

0 comments on commit 196158f

Please sign in to comment.