From 88b733d0d00e56756aa9cf8e7115b27cceef35e9 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 1 Dec 2013 01:10:09 +0000 Subject: Add node_type to XML nodes --- mammoth/xmlparser.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mammoth/xmlparser.py') 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 = {} -- cgit v1.2.3