aboutsummaryrefslogtreecommitdiff
path: root/mammoth/docx/xmlparser.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-24 15:58:31 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-24 15:58:31 +0000
commit5605dd1f37f91d0fa627d49332f5550c90e6d2e7 (patch)
tree0c80a6706e6113ff9f46f3765261905663954f35 /mammoth/docx/xmlparser.py
parent6da721b53ccf55afa8b041cd0dc04eb0aa6d51eb (diff)
Check child is element before inspecting name
Diffstat (limited to 'mammoth/docx/xmlparser.py')
-rw-r--r--mammoth/docx/xmlparser.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mammoth/docx/xmlparser.py b/mammoth/docx/xmlparser.py
index 74d8730..2cfe1e0 100644
--- a/mammoth/docx/xmlparser.py
+++ b/mammoth/docx/xmlparser.py
@@ -14,7 +14,10 @@ class XmlElement(XmlElementBase):
def find_children(self, name):
- return XmlElementList(filter(lambda child: child.name == name, self.children))
+ return XmlElementList(filter(
+ lambda child: child.node_type == node_types.element and child.name == name,
+ self.children
+ ))
class XmlElementList(object):