Table of Contents

Module: dom_extensions ../bkchem/oasa/oasa/dom_extensions.py

some extensions to DOM for more convenient work

Functions   
childNodesWithoutEmptySpaces
elementUnder
getAllTextFromElement
getAttributes
getFirstChildNamed
getParentNameList
getTextFromElement
isNotEmptyText
isOnlyTags
safe_indent
setAttributes
simpleXPathSearch
textOnlyElementUnder
  childNodesWithoutEmptySpaces 
childNodesWithoutEmptySpaces ( node )

  elementUnder 
elementUnder (
        parent,
        name,
        attributes=(),
        )

creates element inside of parent and returns it, attributes are as sequence of (name,value) sequences

  getAllTextFromElement 
getAllTextFromElement ( element )

like getTextFromElement but mines text also from child nodes

  getAttributes 
getAttributes ( element,  names )

returns a list of attribute values from a list of attr names

  getFirstChildNamed 
getFirstChildNamed ( element,  name )

  getParentNameList 
getParentNameList ( element )

returns a list of parent names (from father to grandfather...)

  getTextFromElement 
getTextFromElement ( element )

  isNotEmptyText 
isNotEmptyText ( element )

  isOnlyTags 
isOnlyTags ( text )

this function takes a !string! as an argument and returns true if text is only tags

  safe_indent 
safe_indent (
        element,
        level=0,
        step=2,
        )

indents DOM tree. Does not add any extra whitespaces to text elements.

  setAttributes 
setAttributes ( element,  attributes )

  simpleXPathSearch 
simpleXPathSearch ( element,  path )

  textOnlyElementUnder 
textOnlyElementUnder (
        parent,
        name,
        text,
        attributes=(),
        )


Table of Contents

This document was automatically generated on Tue Dec 12 13:46:43 2006 by HappyDoc version 2.1