diff options
author | scoder <none@none> | 2006-12-02 22:04:48 +0100 |
---|---|---|
committer | scoder <none@none> | 2006-12-02 22:04:48 +0100 |
commit | 2dd4bab1ecffcb2cfbfdd41529edb53a12ac7709 (patch) | |
tree | df44b133b081d7670710e1e4b39e59eb972466ee /src | |
parent | 48a89eb837a9be497f0f130af0b0d5c3e403f898 (diff) | |
download | python-lxml-2dd4bab1ecffcb2cfbfdd41529edb53a12ac7709.tar.gz |
[svn r2084] new ElementTree.parser property to hold a reference to the parser that was used to parse the document
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/lxml/etree.pyx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lxml/etree.pyx b/src/lxml/etree.pyx index 51d9b7e0..7310a874 100644 --- a/src/lxml/etree.pyx +++ b/src/lxml/etree.pyx @@ -467,6 +467,15 @@ cdef public class _ElementTree [ type LxmlElementTreeType, self._assertHasRoot() return DocInfo(self._context_node._doc) + property parser: + """The parser that was used to parse the document in this ElementTree. + """ + def __get__(self): + if self._context_node is not None and \ + self._context_node._doc is not None: + return self._context_node._doc._parser + return None + def write(self, file, encoding=None, pretty_print=False, xml_declaration=None): """Write the tree to a file or file-like object. |