summaryrefslogtreecommitdiff
path: root/vim-latex/doc/db2vim/domutils.py
diff options
context:
space:
mode:
authorDavid Kaufmann <astra@fsinf.at>2011-11-14 00:13:19 +0100
committerDavid Kaufmann <astra@fsinf.at>2011-11-14 00:13:19 +0100
commit14d64785aaac4bb792f31c2fafb7332b74612c9f (patch)
tree77db363a3c174a4a3c1a6f183759de69905b70e3 /vim-latex/doc/db2vim/domutils.py
downloadconfig-14d64785aaac4bb792f31c2fafb7332b74612c9f.tar.gz
init copy
Diffstat (limited to 'vim-latex/doc/db2vim/domutils.py')
-rw-r--r--vim-latex/doc/db2vim/domutils.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/vim-latex/doc/db2vim/domutils.py b/vim-latex/doc/db2vim/domutils.py
new file mode 100644
index 0000000..83351ff
--- /dev/null
+++ b/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