Package lxml :: Module etree :: Class CustomElementClassLookup
[show private | hide private]
[frames | no frames]

Type CustomElementClassLookup

            object --+        
                     |        
    ElementClassLookup --+    
                         |    
FallbackElementClassLookup --+
                             |
                            CustomElementClassLookup

Known Subclasses:
HtmlElementClassLookup

Element class lookup based on a subclass method.

You can inherit from this class and override the method

    lookup(self, type, doc, namespace, name)

to lookup the element class for a node. Arguments of the method:
* type:      one of 'element', 'comment', 'PI', 'entity'
* doc:       document that the node is in
* namespace: namespace URI of the node (or None for comments/PIs/entities)
* name:      name of the element/entity, None for comments, target for PIs

If you return None from this method, the fallback will be called.

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
  lookup(...)
    Inherited from FallbackElementClassLookup
  setFallback(...)
Sets the fallback scheme for this lookup method.
    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 0x401cb890>
    Inherited from FallbackElementClassLookup
member_descriptor fallback = <member 'fallback' of 'lxml.etree.FallbackEle...

Method Details

__init__(...)
(Constructor)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides:
lxml.etree.FallbackElementClassLookup.__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:
lxml.etree.FallbackElementClassLookup.__new__

Class Variable Details

__pyx_vtable__

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

Generated by Epydoc 2.1 on Sat Aug 18 12:44:28 2007 http://epydoc.sf.net