You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/pythonimportlibxml2#$ sudo apt-get install python3-libxml2doc=libxml2.parseFile('/tmp/elements.xml')
# get values of all children based on their parentdefvaluesOfParent(parent_name):
r=doc.xpathEval('//parent[@name="'+parent_name+'"]/child/@value')
foriinr:
print(i.content)
valuesOfParent('A')
valuesOfParent('B')