diff options
Diffstat (limited to 'Tools/Python/XmlRoutines.py')
-rwxr-xr-x | Tools/Python/XmlRoutines.py | 7 |
1 files changed, 7 insertions, 0 deletions
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('<empty/>') +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('<empty/>') + def XmlParseFileSection (FileName, Tag): """Parse a section of an XML file into a DOM(Document Object Model) and return the DOM.""" try: |