web/ldt/utils/xml.py
author ymh <ymh.work@gmail.com>
Sat, 12 Jun 2010 04:25:05 +0200
changeset 0 cc4a51750724
permissions -rw-r--r--
first commit
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
cc4a51750724 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
def getText(anode):
cc4a51750724 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
	nodelist = anode.childNodes
cc4a51750724 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
	rc = ""
cc4a51750724 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
	for node in nodelist:
cc4a51750724 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
		if node.nodeType == node.TEXT_NODE:
cc4a51750724 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
			rc = rc + node.data
cc4a51750724 first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
	return rc