Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get nodes of xml in python

import xml.dom.minidom
dom = xml.dom.minidom.parseString(document)
def getText(nodelist):
    rc = []
    for node in nodelist:
# check if it is TEXT node or not.
# if it is text node then we are getting the data.
        if node.nodeType == node.TEXT_NODE:
            rc.append(node.data)
    return ''.join(rc)
Source by www.alixaprodev.com #
 
PREVIOUS NEXT
Tagged: #nodes #xml #python
ADD COMMENT
Topic
Name
6+7 =