Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

extracts attribute python xml

from lxml import etree
doc = etree.parse(filename)

memoryElem = doc.find('memory')
print memoryElem.text        # element text
print memoryElem.get('unit') # attribute
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #extracts #attribute #python #xml
ADD COMMENT
Topic
Name
3+7 =