Package lxml :: Module objectify :: Class ObjectifiedElement
[show private | hide private]
[frames | no frames]

Type ObjectifiedElement

object --+        
         |        
  _Element --+    
             |    
   ElementBase --+
                 |
                ObjectifiedElement

Known Subclasses:
ObjectifiedDataElement

Main XML Element class.

Element children are accessed as object attributes. Multiple children with the same name are available through a list index. Example:
>>> root = etree.XML("<root><c1><c2>0</c2><c2>1</c2></c1></root>")
>>> second_c2 = root.c1.c2[1]

Method Summary
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __delitem__(x, y)
x.__delitem__(y) <==> del x[y]
  __delslice__(x, i, j)
Use of negative indices is not supported.
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __getitem__(x, y)
x.__getitem__(y) <==> x[y]
  __getslice__(x, i, j)
Use of negative indices is not supported.
  __iter__(x)
x.__iter__() <==> iter(x)
  __len__(x)
x.__len__() <==> len(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __setitem__(x, i, y)
x.__setitem__(i, y) <==> x[i]=y
  __setslice__(x, i, j, y)
Use of negative indices is not supported.
  __str__(x)
x.__str__() <==> str(x)
  addattr(...)
Add a child value to the element.
  countchildren(...)
Return the number of children of this element, regardless of their name.
  descendantpaths(...)
Returns a list of object path expressions for all descendants.
  find(...)
  findall(...)
  findtext(...)
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle

Class Variable Summary
getset_descriptor text = <attribute 'text' of 'lxml.objectify.ObjectifiedE...

Method Details

__delattr__(...)

x.__delattr__('name') <==> del x.name
Overrides:
__builtin__.object.__delattr__

__delitem__(x, y)
(Index deletion operator)

x.__delitem__(y) <==> del x[y]
Returns:
del x[y]
Overrides:
lxml.etree._Element.__delitem__

__delslice__(x, i, j)
(Slice deletion operator)

Use of negative indices is not supported.
Returns:
del x[i:j]
Overrides:
lxml.etree._Element.__delslice__

__getattribute__(...)

x.__getattribute__('name') <==> x.name
Overrides:
__builtin__.object.__getattribute__

__getitem__(x, y)
(Indexing operator)

x.__getitem__(y) <==> x[y]
Returns:
x[y]
Overrides:
lxml.etree._Element.__getitem__

__getslice__(x, i, j)
(Slicling operator)

Use of negative indices is not supported.
Returns:
x[i:j]
Overrides:
lxml.etree._Element.__getslice__

__iter__(x)

x.__iter__() <==> iter(x)
Returns:
iter(x)
Overrides:
lxml.etree._Element.__iter__

__len__(x)
(Length operator)

x.__len__() <==> len(x)
Returns:
len(x)
Overrides:
lxml.etree._Element.__len__

__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.ElementBase.__new__

__setattr__(...)

x.__setattr__('name', value) <==> x.name = value
Overrides:
__builtin__.object.__setattr__

__setitem__(x, i, y)
(Index assignment operator)

x.__setitem__(i, y) <==> x[i]=y
Returns:
x[i]=y
Overrides:
lxml.etree._Element.__setitem__

__setslice__(x, i, j, y)
(Slice assignment operator)

Use of negative indices is not supported.
Returns:
x[i:j]=y
Overrides:
lxml.etree._Element.__setslice__

__str__(x)
(Informal representation operator)

x.__str__() <==> str(x)
Returns:
str(x)
Overrides:
__builtin__.object.__str__

addattr(...)

Add a child value to the element.

As opposed to append(), it sets a data value, not an element.

countchildren(...)

Return the number of children of this element, regardless of their name.

descendantpaths(...)

Returns a list of object path expressions for all descendants.

Class Variable Details

text

Type:
getset_descriptor
Value:
<attribute 'text' of 'lxml.objectify.ObjectifiedElement' objects>      

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