xmlsec.tree

Common XML utility functions

xmlsec.tree.add_ids()

Registers ids as ids used below node. ids is a sequence of attribute names used as XML ids in the subtree rooted at node. A call to addIds may be necessary to make known which attributes contain XML ids. This is the case, if a transform references an id via XPointer or a self document uri and the id inkey_data_formation is not available by other means (e.g. an associated DTD or XML schema).

Parameters:
  • node – the pointer to XML node
  • ids – the list of ID attributes.
xmlsec.tree.find_child()

Searches a direct child of the parent node having given name and namespace href.

Parameters:
  • parent – the pointer to XML node
  • name – the name
  • namespace – the namespace href(optional)
Returns:

the pointer to the found node or None if node is not found

xmlsec.tree.find_node()

Searches all children of the parent node having given name and namespace href.

Parameters:
  • node – the pointer to XML node
  • name – the name
  • namespace – the namespace href(optional)
Returns:

the pointer to the found node or None if node is not found

xmlsec.tree.find_parent()

Searches the ancestors axis of the node having given name and namespace href.

Parameters:
  • node – the pointer to XML node
  • name – the name
  • namespace – the namespace href(optional)
Returns:

the pointer to the found node or None if node is not found

Table of contents