From 5605dd1f37f91d0fa627d49332f5550c90e6d2e7 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 24 Dec 2013 15:58:31 +0000 Subject: Check child is element before inspecting name --- mammoth/docx/xmlparser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mammoth/docx/xmlparser.py') 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): -- cgit v1.2.3