diff options
| author | David Kaufmann <astra@fsinf.at> | 2011-11-14 02:04:57 +0100 |
|---|---|---|
| committer | David Kaufmann <astra@fsinf.at> | 2011-11-14 02:05:03 +0100 |
| commit | d14e32945633316b352efec22a1ab4ffd00cb618 (patch) | |
| tree | 353b04d57ab9134d1f546440395d75754a69542f /src/vim-latex/doc/db2vim/domutils.py | |
| parent | a76ddbccedbd9873342629d07fdb0cd8ba536cc0 (diff) | |
| download | config-d14e32945633316b352efec22a1ab4ffd00cb618.tar.gz | |
moved sources to src
Diffstat (limited to 'src/vim-latex/doc/db2vim/domutils.py')
| -rw-r--r-- | src/vim-latex/doc/db2vim/domutils.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/vim-latex/doc/db2vim/domutils.py b/src/vim-latex/doc/db2vim/domutils.py new file mode 100644 index 0000000..83351ff --- /dev/null +++ b/src/vim-latex/doc/db2vim/domutils.py @@ -0,0 +1,25 @@ +def GetTextFromElementNode(element, childNamePattern): + children = element.getElementsByTagName(childNamePattern) + texts = [] + for child in children: + texts.append(GetText(child.childNodes)) + + return texts + +def GetText(nodelist): + rc = "" + for node in nodelist: + if node.nodeType == node.TEXT_NODE: + rc = rc + node.data + return rc + +def GetTextFromElement(element): + text = "" + child = element.firstChild + while not child.nextSibling is None: + child = child.nextSibling + print child + if child.nodeType == child.TEXT_NODE: + text = text + child.data + + return text |
