Package lxml :: Module etree :: Class __ContentOnlyElement

[hide private]
[frames] | no frames]

# Class __ContentOnlyElement

    object --+
             |
      _Element --+
                 |
                __ContentOnlyElement

Known Subclasses:
  - _Comment
  - , _Entity
  - , _ProcessingInstruction

Instance Methods | [hide private]

__delitem__(x, y) del x[y] |

__getitem__(self, x) Returns the subelement at the given position or the requested slice. |

__len__(x) len(x) |

a new object with type S, a subtype of T

__new__(T, S, ...) |

__setitem__(x, i, y) x[i]=y |

append(self, value) Adds a subelement to the end of this element. |

get(self, key, default=None) Gets an element attribute. |

insert(self, index, value) Inserts a subelement at the given position in this element |

items(self) Gets element attributes, as a sequence. |

keys(self) Gets a list of attribute names. |

set(self, key, value) Sets an element attribute. |

values(self) Gets element attribute values as a sequence of strings. |

Inherited from `_Element`: `__contains__`, `__copy__`, `__deepcopy__`, `__iter__`, `__nonzero__`, `__repr__`, `__reversed__`, `addnext`, `addprevious`, `clear`, `extend`, `find`, `findall`, `findtext`, `getchildren`, `getiterator`, `getnext`, `getparent`, `getprevious`, `getroottree`, `index`, `iter`, `iterancestors`, `iterchildren`, `iterdescendants`, `iterfind`, `itersiblings`, `itertext`, `makeelement`, `remove`, `replace`, `xpath`

Inherited from `_Element` (private): `_init`

Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__init__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__str__`

Properties | [hide private]

| attrib Element attribute dictionary.
| text Text before the first subelement.
Inherited from `_Element`: `base`, `nsmap`, `prefix`, `sourceline`, `tag`, `tail` Inherited from `object`: `__class__`

Method Details | [hide private]

### __delitem__(x, y)
(Index deletion operator)

del x[y]

Overrides: _Element.__delitem__

### __getitem__(self, x)
(Indexing operator)

Returns the subelement at the given position or the requested slice.

Overrides: _Element.__getitem__

### __len__(x)
(Length operator)

len(x)

Overrides: _Element.__len__

### __new__(T, S, ...)

Returns: a new object with type S, a subtype of T
Overrides: object.__new__

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

x[i]=y

Overrides: _Element.__setitem__

### append(self, value)

Adds a subelement to the end of this element.

Overrides: _Element.append

### get(self, key, default=None)

Gets an element attribute.

Overrides: _Element.get

### insert(self, index, value)

Inserts a subelement at the given position in this element

Overrides: _Element.insert

### items(self)

Gets element attributes, as a sequence. The attributes are returned in an arbitrary order.

Overrides: _Element.items

### keys(self)

Gets a list of attribute names. The names are returned in an arbitrary order (just like for an ordinary Python dictionary).

Overrides: _Element.keys

### set(self, key, value)

Sets an element attribute.

Overrides: _Element.set

### values(self)

Gets element attribute values as a sequence of strings. The attributes are returned in an arbitrary order.

Overrides: _Element.values