diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-12-24 15:58:31 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-12-24 15:58:31 +0000 |
| commit | 5605dd1f37f91d0fa627d49332f5550c90e6d2e7 (patch) | |
| tree | 0c80a6706e6113ff9f46f3765261905663954f35 /mammoth | |
| parent | 6da721b53ccf55afa8b041cd0dc04eb0aa6d51eb (diff) | |
Check child is element before inspecting name
Diffstat (limited to 'mammoth')
| -rw-r--r-- | mammoth/docx/xmlparser.py | 5 |
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): |
