Package simplexmlapi :: Module node :: Class DotNode
[hide private]
[frames] | no frames]

Class DotNode

source code

object --+
         |
        DotNode

An object whose getattr gets child nodes.

Instance Methods [hide private]
 
__init__(self, node)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__getattr__(self, attr)
Split the attribute and pass it to delegate to be sent on to the resolving method.
source code
str
getName(self)
Returns: The tag name of the root node.
source code
DotNodeAttribute or DotNodeList
getChildren(self, name, *args)
Attempt to resolve name as the tag name of a Node.
source code
DotNodeList
getItem(self, name, idx)
Attempt to retrieve the idxth child node that has tagName name.
source code
DotNodeAttribute
getAttribute(self, name, *args)
Get the name attribute on self._node.
source code
str
getValue(self)
Get the text value of self._node.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]
str _
Get the text value of self._node.

Inherited from object: __class__

Method Details [hide private]

__init__(self, node)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • node (Node) - The Node to wrap.
Overrides: object.__init__

getName(self)

source code 
Returns: str
The tag name of the root node.

getChildren(self, name, *args)

source code 

Attempt to resolve name as the tag name of a Node. If no node with that name exists, attempt to resolve it as an Attr.

Parameters:
  • name (str) - The name to attempt to resolve.
Returns: DotNodeAttribute or DotNodeList
The matching nodes or attribute.

getItem(self, name, idx)

source code 

Attempt to retrieve the idxth child node that has tagName name.

Parameters:
  • name (str) - The tag name to resolve into child nodes.
  • idx (int) - The list index
Returns: DotNodeList
A sequence containing the matching node.

getAttribute(self, name, *args)

source code 

Get the name attribute on self._node.

Parameters:
  • name (str) - The attribute name
Returns: DotNodeAttribute
The matching attribute

getValue(self)

source code 

Get the text value of self._node.

Returns: str
The text value of self._node

Property Details [hide private]

_

Get the text value of self._node.

Get Method:
getValue(self) - Get the text value of self._node.
Type:
str