aboutsummaryrefslogtreecommitdiff
path: root/mammoth/xmlparser.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-01 01:10:09 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-01 01:10:09 +0000
commit88b733d0d00e56756aa9cf8e7115b27cceef35e9 (patch)
tree058de2392196fa38156d008b18f561a4586385ae /mammoth/xmlparser.py
parent310a7650bbe2ebbb9f049684520a7539bbb55672 (diff)
Add node_type to XML nodes
Diffstat (limited to 'mammoth/xmlparser.py')
-rw-r--r--mammoth/xmlparser.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/mammoth/xmlparser.py b/mammoth/xmlparser.py
index bd344a0..c645ad4 100644
--- a/mammoth/xmlparser.py
+++ b/mammoth/xmlparser.py
@@ -10,6 +10,16 @@ element = XmlElement
text = XmlText
+class node_types(object):
+ element = 1
+ text = 3
+
+
+XmlElement.node_type = node_types.element
+XmlText.node_type = node_types.text
+
+
+
def parse_xml(fileobj, namespace_mapping=None):
if namespace_mapping is None:
namespace_prefixes = {}