from xml.dom import minidom
xmldoc = minidom.parse('config.xml')
roleList = xmldoc.getElementsByTagName('role')
for role in roleList:
roleName = role.attributes['name'].value
if roleName == "prj_user_prd":
print "roleName:",roleName
userList = role.getElementsByTagName("assignedSIDs")[0].getElementsByTagName("sid")
break
for user in userList:
print user.firstChild.nodeValue
from xml.dom import minidom
xmldoc = minidom.parse('config.xml')
roleList = xmldoc.getElementsByTagName('role')
for role in roleList:
roleName = role.attributes['name'].
value
print("Role:" + roleName)
userList = role.getElementsByTagName("assignedSIDs")[0].getElementsByTagName("sid")
for user in userList:
print(user.firstChild.nodeValue)
print()