def ProcessXml(self, xml_str):
"""Parses XML string and returns object representation of relevant info.
Args:
xml_str: The XML string.
Returns:
A list of Backend object containg information about backends from the XML.
Raises:
AppEngineConfigException: In case of malformed XML or illegal inputs.
"""
try:
self.backends = []
self.errors = []
xml_root = ElementTree.fromstring(xml_str)
for child in xml_root.getchildren():
self.ProcessBackendNode(child)
if self.errors:
raise AppEngineConfigException('\n'.join(self.errors))
return self.backends
except ElementTree.ParseError:
raise AppEngineConfigException('Bad input -- not valid XML')
评论列表
文章目录