diff options
author | scoder <none@none> | 2009-05-31 14:13:49 +0200 |
---|---|---|
committer | scoder <none@none> | 2009-05-31 14:13:49 +0200 |
commit | 72564ab3843b9755820ae2ebda8ded7b34e07d64 (patch) | |
tree | 8be5a7c4a60f44fa2c7d5bb681f5a228ddd45384 /src/lxml/iterparse.pxi | |
parent | c6a744809a9711a71e77845d448de62fbed06e47 (diff) | |
download | python-lxml-72564ab3843b9755820ae2ebda8ded7b34e07d64.tar.gz |
[svn r4147] r5120@delle: sbehnel | 2009-05-12 19:58:31 +0200
support optional PARSE_HUGE option also for iterparse()
--HG--
branch : trunk
Diffstat (limited to 'src/lxml/iterparse.pxi')
-rw-r--r-- | src/lxml/iterparse.pxi | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lxml/iterparse.pxi b/src/lxml/iterparse.pxi index 6f62d8d8..761e771f 100644 --- a/src/lxml/iterparse.pxi +++ b/src/lxml/iterparse.pxi @@ -309,7 +309,7 @@ cdef inline xmlNode* _iterparseFindLastNode(xmlparser.xmlParserCtxt* c_ctxt): return c_ctxt.node.next cdef class iterparse(_BaseParser): - u"""iterparse(self, source, events=("end",), tag=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, remove_blank_text=False, remove_comments=False, remove_pis=False, encoding=None, html=False, schema=None) + u"""iterparse(self, source, events=("end",), tag=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, remove_blank_text=False, remove_comments=False, remove_pis=False, encoding=None, html=False, huge_tree=False, schema=None) Incremental parser. @@ -346,6 +346,8 @@ Available boolean keyword arguments: - strip_cdata: replace CDATA sections by normal text content (default: True) - compact: safe memory for short text content (default: True) - resolve_entities: replace entities by their text value (default: True) + - huge_tree: disable security restrictions and support very deep trees + and very long text content (only affects libxml2 2.7+) Other keyword arguments: - encoding: override the document encoding @@ -363,7 +365,7 @@ Other keyword arguments: load_dtd=False, no_network=True, remove_blank_text=False, compact=True, resolve_entities=True, remove_comments=False, remove_pis=False, strip_cdata=True, encoding=None, - html=False, XMLSchema schema=None): + html=False, huge_tree=False, XMLSchema schema=None): cdef _IterparseContext context cdef char* c_encoding cdef int parse_options @@ -395,6 +397,8 @@ Other keyword arguments: xmlparser.XML_PARSE_DTDLOAD if remove_blank_text: parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS + if huge_tree: + parse_options = parse_options | xmlparser.XML_PARSE_HUGE if not no_network: parse_options = parse_options ^ xmlparser.XML_PARSE_NONET if not compact: |