Class XMLParser
[show private | hide private]
[frames | no frames]

Type XMLParser

 object --+    
          |    
_BaseParser --+
              |
             XMLParser


The XML parser. Parsers can be supplied as additional argument to various parse functions of the lxml API. A default parser is always available and can be replaced by a call to the global function 'set_default_parser'. New parsers can be created at any time without a major run-time overhead.

The keyword arguments in the constructor are mainly based on the libxml2 parser configuration. A DTD will also be loaded if validation or attribute default values are requested.

Available boolean keyword arguments: * attribute_defaults - read default attributes from DTD * dtd_validation - validate (if DTD is available) * load_dtd - use DTD for parsing * no_network - prevent network access * ns_clean - clean up redundant namespace declarations * recover - try hard to parse through broken XML * remove_blank_text - discard blank text nodes * remove_comments - discard comments * remove_pis - discard processing instructions * compact - safe memory for short text content (default: True)

Note that you should avoid sharing parsers between threads. While this is not harmful, it is more efficient to use separate parsers. This does not apply to the default parser.
Method Summary
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
    Inherited from _BaseParser
  copy(...)
Create a new parser with the same configuration.
  makeelement(...)
Creates a new element associated with this parser.
  setElementClassLookup(...)
Set a lookup scheme for element classes generated from this parser.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
PyCObject __pyx_vtable__ = <PyCObject object at 0x401c3890>
    Inherited from _BaseParser
getset_descriptor error_log = <attribute 'error_log' of 'etree._BaseParser...
member_descriptor resolvers = <member 'resolvers' of 'etree._BaseParser' o...

Method Details

__init__(...)
(Constructor)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides:
None._BaseParser.__init__

__new__(T, S, ...)

T.__new__(S, ...) -> a new object with type S, a subtype of T
Returns:
a new object with type S, a subtype of T
Overrides:
None._BaseParser.__new__

Class Variable Details

__pyx_vtable__

Type:
PyCObject
Value:
<PyCObject object at 0x401c3890>                                       

Generated by Epydoc 2.1 on Thu Jul 26 19:14:08 2007 http://epydoc.sf.net