X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Tools%2FPython%2FXmlRoutines.py;h=53f5aa8f6157057b24cdf4d965923be3859d6c0e;hb=3b7a53b68361391b97b99ef4108a033ed044736a;hp=2707bcbb978c4fc08411c055cedf6a01e27b82cf;hpb=fc7599b9aab646dbc2e8eb90946688c8b22743d4;p=mirror_edk2.git diff --git a/Tools/Python/XmlRoutines.py b/Tools/Python/XmlRoutines.py index 2707bcbb97..53f5aa8f61 100755 --- a/Tools/Python/XmlRoutines.py +++ b/Tools/Python/XmlRoutines.py @@ -1,7 +1,16 @@ #!/usr/bin/env python -# This is an XML API that uses a syntax similar to XPath, but it is written in -# standard python so that no extra python packages are required to use it. +# Copyright (c) 2007, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +"""This is an XML API that uses a syntax similar to XPath, but it is written in +standard python so that no extra python packages are required to use it.""" import xml.dom.minidom @@ -35,10 +44,10 @@ def XmlElementData (Dom): """Get the text for this element.""" return Dom.firstChild.data.strip() -def XmlAttribute (Dom, String): - """Return a single attribute that named by String.""" +def XmlAttribute (Dom, AttName): + """Return a single attribute named AttName.""" try: - return Dom.getAttribute(String) + return Dom.getAttribute(AttName) except: return ''