Package gavo :: Package user :: Module rdmanipulator :: Class Element
[frames] | no frames]

Class Element

source code

object --+    
         |    
      list --+
             |
            Element

a sentinel for XML elements.

These are constructed with lists of the type [tag,...]; the opening (or empty) tag is always item 0.

Instance Methods
new empty list
__init__(self, t)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
append(self, newChild)
append object to end
source code
 
getAttribute(self, name)
returns the Attribute element with name within self.
source code
 
findElement(self, name)
returns the first element called name somewhere within the xml grammar-parsed parseResult
source code
 
countElements(self, name)
returns the number of name elements that are direct children of self.
source code

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, __sizeof__, count, extend, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables

Inherited from list: __hash__

Properties

Inherited from object: __class__

Method Details

__init__(self, t)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Returns: new empty list
Overrides: object.__init__
(inherited documentation)

append(self, newChild)

source code 

append object to end

Overrides: list.append
(inherited documentation)

getAttribute(self, name)

source code 

returns the Attribute element with name within self.

If no such attribute exists, a KeyError is raised.

findElement(self, name)

source code 

returns the first element called name somewhere within the xml grammar-parsed parseResult

This is a depth-first search, and it will return None if there is no such element.