Skip to content
Snippets Groups Projects
Commit 8619b7b9 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

ENH: improved handling of non-existing text nodes

parent 06e81f32
Branches
Tags
2 merge requests!181Release 0.9.0,!174XML Converter
......@@ -97,7 +97,10 @@ class XMLTagConverter(Converter):
vardict.update(m_tag.groupdict())
if "match_text" in self.definition:
m_text = re.match(self.definition["match_text"], element.tag.text)
tagtext = element.tag.text
if element.tag.text is None:
tagtext = ""
m_text = re.match(self.definition["match_text"], tagtext, re.DOTALL)
if m_text is None:
return None
vardict.update(m_text.groupdict())
......@@ -114,7 +117,6 @@ class XMLTagConverter(Converter):
matched_m_attrib = m_attrib
m_attrib_value = re.match(attrib_def_value, attr_value)
if m_attrib_value is None:
breakpoint()
return None
matched_m_attrib_value = m_attrib_value
# TODO: How to deal with multiple matches?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment