X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FPython%2FXmlRoutines.py;h=1757ea019cf289ae0a8dfd2b2d1a06080e465bff;hp=0345f4acc645bc6fc533a0c3aa2aa3c682dbff5b;hb=24a86f9acc0773579aaa8560dc196e443c0e5cfc;hpb=2897231803d9d506f7cb7c68eeb59dcc4805084d diff --git a/Tools/Python/XmlRoutines.py b/Tools/Python/XmlRoutines.py index 0345f4acc6..1757ea019c 100755 --- a/Tools/Python/XmlRoutines.py +++ b/Tools/Python/XmlRoutines.py @@ -73,6 +73,13 @@ def XmlParseFile (FileName): except: return xml.dom.minidom.parseString('') +def XmlParseString (Str): + """Parse an XML string into a DOM and return the DOM.""" + try: + return xml.dom.minidom.parseString(Str) + except: + return xml.dom.minidom.parseString('') + def XmlParseFileSection (FileName, Tag): """Parse a section of an XML file into a DOM(Document Object Model) and return the DOM.""" try: