module documentation
(source)

A library for performing interesting tasks with DOM objects.
Class ​Node​Lookup​Error Undocumented
Class ​Raw​Text No summary
Function clear​Node Remove all children from the given node.
Function find​Elements Return an iterable of the elements which are children of parent for which the predicate matcher returns true.
Function find​Elements​With​Attribute Undocumented
Function find​Elements​With​Attribute​Shallow Return an iterable of the elements which are direct children of parent and which have the attribute attribute.
Function find​Nodes Undocumented
Function find​Nodes​Named Undocumented
Function find​Nodes​Shallow Undocumented
Function find​Nodes​Shallow​On​Match Undocumented
Function gather​Text​Nodes No summary
Function get Get a node with the specified nodeId as any of the class, id or pattern attributes. If there is no such node, raise NodeLookupError.
Function get​And​Clear Get a node with the specified nodeId as any of the class, id or pattern attributes. If there is no such node, raise NodeLookupError. Remove all child nodes before returning.
Function get​If​Exists Get a node with the specified nodeId as any of the class, id or pattern attributes. If there is no such node, return None.
Function get​Node​Text Undocumented
Function get​Parents Undocumented
Function locate​Nodes Find subnodes in the given node where the given attribute has the given value.
Function named​Children namedChildren(parent, nodeName) -> children (not descendants) of parent that have tagName == nodeName
Function substitute Look through the given node's children for strings, and attempt to do string substitution with the given parameter.
Function super​Append​Attribute Undocumented
Function super​Prepend​Attribute Undocumented
Function super​Set​Attribute Undocumented
Function write​Node​Data Undocumented
Function _get (internal) Get a node with the specified nodeId as any of the class, id or pattern attributes.
def clearNode(node): (source)
Remove all children from the given node.
def findElements(parent, matcher): (source)
Return an iterable of the elements which are children of parent for which the predicate matcher returns true.
def findElementsWithAttribute(parent, attribute, value=None): (source)

Undocumented

def findElementsWithAttributeShallow(parent, attribute): (source)
Return an iterable of the elements which are direct children of parent and which have the attribute attribute.
def findNodes(parent, matcher, accum=None): (source)

Undocumented

def findNodesNamed(parent, name): (source)

Undocumented

def findNodesShallow(parent, matcher, accum=None): (source)

Undocumented

def findNodesShallowOnMatch(parent, matcher, recurseMatcher, accum=None): (source)

Undocumented

def gatherTextNodes(iNode, dounescape=0, joinWith=''): (source)

Visit each child node and collect its text data, if any, into a string. For example:

    >>> doc=microdom.parseString('<a>1<b>2<c>3</c>4</b></a>')
    >>> gatherTextNodes(doc.documentElement)
    '1234'

With dounescape=1, also convert entities back into normal characters.

Returns
strthe gathered nodes as a single string
def get(node, nodeId): (source)
Get a node with the specified nodeId as any of the class, id or pattern attributes. If there is no such node, raise NodeLookupError.
def getAndClear(node, nodeId): (source)
Get a node with the specified nodeId as any of the class, id or pattern attributes. If there is no such node, raise NodeLookupError. Remove all child nodes before returning.
def getIfExists(node, nodeId): (source)
Get a node with the specified nodeId as any of the class, id or pattern attributes. If there is no such node, return None.
def getNodeText(node): (source)

Undocumented

def getParents(node): (source)

Undocumented

def locateNodes(nodeList, key, value, noNesting=1): (source)
Find subnodes in the given node where the given attribute has the given value.
def namedChildren(parent, nodeName): (source)
namedChildren(parent, nodeName) -> children (not descendants) of parent that have tagName == nodeName
def substitute(request, node, subs): (source)
Look through the given node's children for strings, and attempt to do string substitution with the given parameter.
def superAppendAttribute(node, key, value): (source)

Undocumented

def superPrependAttribute(node, key, value): (source)

Undocumented

def superSetAttribute(node, key, value): (source)

Undocumented

def writeNodeData(node, oldio): (source)

Undocumented

def _get(node, nodeId, nodeAttrs=('id', 'class', 'model', 'pattern')): (source)
(internal) Get a node with the specified nodeId as any of the class, id or pattern attributes.