# 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) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# Import Modules\r
#\r
import xml.dom.minidom\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
\r
## Create a element of XML\r
#\r
def CreateXmlElement(Name, String, NodeList, AttributeList):\r
Doc = xml.dom.minidom.Document()\r
Element = Doc.createElement(Name)\r
- if String != '' and String != None:\r
+ if String != '' and String is not None:\r
Element.appendChild(Doc.createTextNode(String))\r
\r
for Item in NodeList:\r
if type(Item) == type([]):\r
Key = Item[0]\r
Value = Item[1]\r
- if Key != '' and Key != None and Value != '' and Value != None:\r
+ if Key != '' and Key is not None and Value != '' and Value is not None:\r
Node = Doc.createElement(Key)\r
Node.appendChild(Doc.createTextNode(Value))\r
Element.appendChild(Node)\r
for Item in AttributeList:\r
Key = Item[0]\r
Value = Item[1]\r
- if Key != '' and Key != None and Value != '' and Value != None:\r
+ if Key != '' and Key is not None and Value != '' and Value is not None:\r
Element.setAttribute(Key, Value)\r
\r
return Element\r
# @revel Nodes A list of XML nodes matching XPath style Sting.\r
#\r
def XmlList(Dom, String):\r
- if String == None or String == "" or Dom == None or Dom == "":\r
+ if String is None or String == "" or Dom is None or Dom == "":\r
return []\r
if Dom.nodeType == Dom.DOCUMENT_NODE:\r
Dom = Dom.documentElement\r
# @revel Node A single XML node matching XPath style Sting.\r
#\r
def XmlNode(Dom, String):\r
- if String == None or String == "" or Dom == None or Dom == "":\r
+ if String is None or String == "" or Dom is None or Dom == "":\r
return ""\r
if Dom.nodeType == Dom.DOCUMENT_NODE:\r
Dom = Dom.documentElement\r