# This is an XML API that uses a syntax similar to XPath, but it is written in\r
# standard python so that no extra python packages are required to use it.\r
#\r
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\r
-# This program and the accompanying materials are licensed and made available \r
-# under the terms and conditions of the BSD License which accompanies this \r
-# distribution. The full text of the license may be found at \r
+# This program and the accompanying materials are licensed and made available\r
+# under the terms and conditions of the BSD License which accompanies this\r
+# distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
Element.appendChild(Doc.createTextNode(String))\r
\r
for Item in NodeList:\r
- if type(Item) == type([]):\r
+ if isinstance(Item, type([])):\r
Key = Item[0]\r
Value = Item[1]\r
if Key != '' and Key is not None and Value != '' and Value is not None:\r
## Get a single XML element using XPath style syntax.\r
#\r
# Similar with XmlElement, but do not strip all the leading and tailing space\r
-# and newline, instead just remove the newline and spaces introduced by \r
-# toprettyxml() \r
+# and newline, instead just remove the newline and spaces introduced by\r
+# toprettyxml()\r
#\r
# @param Dom The root XML DOM object.\r
# @param Strin A XPath style path.\r
Dom = xml.dom.minidom.parse(XmlFile)\r
XmlFile.close()\r
return Dom\r
- except BaseException, XExcept:\r
+ except BaseException as XExcept:\r
XmlFile.close()\r
Logger.Error('\nUPT', PARSER_ERROR, XExcept, File=FileName, RaiseError=True)\r