- Merged the local copy of XmlRoutines.py in buildgen into upper directory's XmlRouti...
[mirror_edk2.git] / Tools / Python / buildgen / SurfaceAreaElement.py
index 29aaa83..2f022c7 100644 (file)
@@ -13,7 +13,7 @@
 #\r
 # TODO: FFS layout, Flash, FV, PCD\r
 #\r
-import os, sys, re, getopt, string, glob, xml.dom.minidom, pprint, time, copy, shelve\r
+import os, sys, re, getopt, string, glob, xml.dom.minidom, pprint, time, copy, shelve, pickle\r
 from XmlRoutines import *\r
 import FrameworkElement\r
 import BuildConfig\r
@@ -243,7 +243,7 @@ class LibraryDeclaration(FrameworkElement.LibraryInterface, SurfaceAreaElement):
     def Parse(self):\r
         dom = self._Root\r
         self.Name = XmlAttribute(dom, "Name")\r
-        self.Path = os.path.normpath(XmlElementData(XmlElement(dom, "/LibraryClass/IncludeHeader")))\r
+        self.Path = os.path.normpath(XmlElementData(XmlNode(dom, "/LibraryClass/IncludeHeader")))\r
         self.Dir  = os.path.dirname(self.Path)\r
         \r
         attribute = XmlAttribute(dom, "RecommendedInstanceGuid")\r
@@ -268,7 +268,7 @@ class LibraryClass(FrameworkElement.LibraryClass, SurfaceAreaElement):
     def Parse(self):\r
         dom = self._Root\r
         \r
-        self.Name = XmlElementData(XmlElement(dom, "/LibraryClass/Keyword"))\r
+        self.Name = XmlElementData(XmlNode(dom, "/LibraryClass/Keyword"))\r
         self.Usage = self.GetUsage(dom)\r
         self.Features = self.GetFeatureList(dom)\r
         self.Archs  = self.GetArchList(dom)\r
@@ -336,7 +336,7 @@ class Protocol(FrameworkElement.Protocol, SurfaceAreaElement):
 \r
     def Parse(self):\r
         dom = self._Root\r
-        self.CName = XmlElementData(XmlElement(dom, "/Protocol/ProtocolCName"))\r
+        self.CName = XmlElementData(XmlNode(dom, "/Protocol/ProtocolCName"))\r
         self.Usage = self.GetUsage(dom)\r
         self.Archs = self.GetArchList(dom)\r
         self.Features = self.GetFeatureList(dom)\r
@@ -354,7 +354,7 @@ class ProtocolNotify(FrameworkElement.ProtocolNotify, SurfaceAreaElement):
     def Parse(self):\r
         dom = self._Root\r
         \r
-        self.CName = XmlElementData(XmlElement(dom, "/ProtocolNotify/ProtocolCName"))\r
+        self.CName = XmlElementData(XmlNode(dom, "/ProtocolNotify/ProtocolCName"))\r
         self.Usage = self.GetUsage(dom)\r
         self.Archs = self.GetArchList(dom)\r
         self.Features = self.GetFeatureList(dom)\r
@@ -371,7 +371,7 @@ class Ppi(FrameworkElement.Ppi, SurfaceAreaElement):
 \r
     def Parse(self):\r
         dom = self._Root\r
-        self.CName = XmlElementData(XmlElement(dom, "/Ppi/PpiCName"))\r
+        self.CName = XmlElementData(XmlNode(dom, "/Ppi/PpiCName"))\r
         self.Usage = self.GetUsage(dom)\r
         self.Archs = self.GetArchList(dom)\r
         self.Features = self.GetFeatureList(dom)\r
@@ -388,7 +388,7 @@ class PpiNotify(FrameworkElement.PpiNotify, SurfaceAreaElement):
 \r
     def Parse(self):\r
         dom = self._Root\r
-        self.CName = XmlElementData(XmlElement(dom, "/PpiNotify/PpiCName"))\r
+        self.CName = XmlElementData(XmlNode(dom, "/PpiNotify/PpiCName"))\r
         self.Usage = self.GetUsage(dom)\r
         self.Archs = self.GetArchList(dom)\r
         self.Features = self.GetFeatureList(dom)\r
@@ -405,7 +405,7 @@ class Guid(FrameworkElement.Guid, SurfaceAreaElement):
 \r
     def Parse(self):\r
         dom = self._Root\r
-        self.CName = XmlElementData(XmlElement(dom, "/GuidCNames/GuidCName"))\r
+        self.CName = XmlElementData(XmlNode(dom, "/GuidCNames/GuidCName"))\r
         self.Usage = self.GetUsage(dom)\r
         self.Archs = self.GetArchList(dom)\r
         self.Features = self.GetFeatureList(dom)\r
@@ -425,43 +425,43 @@ class Extern(FrameworkElement.Extern, SurfaceAreaElement):
         self.Archs = self.GetArchList(dom)\r
         self.Features = self.GetFeatureList(dom)\r
         \r
-        extern = XmlElement(dom, "/Extern/ModuleEntryPoint")\r
+        extern = XmlNode(dom, "/Extern/ModuleEntryPoint")\r
         if extern is not None and extern is not '':\r
             self.ModuleEntryPoints.append(XmlElementData(extern))\r
             \r
-        extern = XmlElement(dom, "/Extern/ModuleUnloadImage")\r
+        extern = XmlNode(dom, "/Extern/ModuleUnloadImage")\r
         if extern is not None and extern is not '':\r
             self.ModuleUnloadImages.append(XmlElementData(extern))\r
             \r
-        extern = XmlElement(dom, "/Extern/Constructor")\r
+        extern = XmlNode(dom, "/Extern/Constructor")\r
         if extern is not None and extern is not '':\r
             self.Constructors.append(XmlElementData(extern))\r
             \r
-        extern = XmlElement(dom, "/Extern/Destructor")\r
+        extern = XmlNode(dom, "/Extern/Destructor")\r
         if extern is not None and extern is not '':\r
             self.Destructors.append(XmlElementData(extern))\r
             \r
-        extern = XmlElement(dom, "/Extern/DriverBinding")\r
+        extern = XmlNode(dom, "/Extern/DriverBinding")\r
         if extern is not None and extern is not '':\r
             self.DriverBindings.append(XmlElementData(extern))\r
             \r
-        extern = XmlElement(dom, "/Extern/ComponentName")\r
+        extern = XmlNode(dom, "/Extern/ComponentName")\r
         if extern is not None and extern is not '':\r
             self.ComponentNames.append(XmlElementData(extern))\r
             \r
-        extern = XmlElement(dom, "/Extern/DriverConfig")\r
+        extern = XmlNode(dom, "/Extern/DriverConfig")\r
         if extern is not None and extern is not '':\r
             self.DriverConfigs.append(XmlElementData(extern))\r
             \r
-        extern = XmlElement(dom, "/Extern/DriverDiag")\r
+        extern = XmlNode(dom, "/Extern/DriverDiag")\r
         if extern is not None and extern is not '':\r
             self.DriverDiags.append(XmlElementData(extern))\r
 \r
-        extern = XmlElement(dom, "/Extern/SetVirtualAddressMapCallBacks")\r
+        extern = XmlNode(dom, "/Extern/SetVirtualAddressMapCallBacks")\r
         if extern is not None and extern is not '':\r
             self.SetVirtualAddressMapCallBacks.append(XmlElementData(extern))\r
 \r
-        extern = XmlElement(dom, "/Extern/ExitBootServicesCallBack")\r
+        extern = XmlNode(dom, "/Extern/ExitBootServicesCallBack")\r
         if extern is not None and extern is not '':\r
             self.ExitBootServicesCallBacks.append(XmlElementData(extern))\r
 \r
@@ -472,7 +472,7 @@ class IndustryStdHeader(FrameworkElement.IncludeFile, SurfaceAreaElement):
 \r
     def Parse(self):\r
         dom = self._Root\r
-        self.Path = os.path.normpath(XmlElementData(XmlElement(dom, "/IndustryStdHeader/IncludeHeader")))\r
+        self.Path = os.path.normpath(XmlElementData(XmlNode(dom, "/IndustryStdHeader/IncludeHeader")))\r
         self.Dir  = os.path.dirname(self.Path)\r
         self.Archs = self.GetArchList(dom)\r
         self.ModuleTypes = self.GetModuleTypeList(dom)\r
@@ -495,8 +495,8 @@ class GuidDeclaration(FrameworkElement.Guid, SurfaceAreaElement):
 \r
     def Parse(self):\r
         dom = self._Root\r
-        self.CName = XmlElementData(XmlElement(dom, "/Entry/C_Name"))\r
-        self.GuidValue = XmlElementData(XmlElement(dom, "/Entry/GuidValue")).upper()\r
+        self.CName = XmlElementData(XmlNode(dom, "/Entry/C_Name"))\r
+        self.GuidValue = XmlElementData(XmlNode(dom, "/Entry/GuidValue")).upper()\r
         self.Name = XmlAttribute(dom, "Name")\r
         self.Types = self.GetGuidTypeList(dom)\r
         self.Archs = self.GetArchList(dom)\r
@@ -518,12 +518,12 @@ class PcdDeclaration(FrameworkElement.Pcd, SurfaceAreaElement):
 \r
     def Parse(self):\r
         dom = self._Root\r
-        self.Types      = XmlElementData(XmlElement(dom, "/PcdEntry/ValidUsage")).split()\r
-        self.CName      = XmlElementData(XmlElement(dom, "/PcdEntry/C_Name"))\r
-        self.Token      = XmlElementData(XmlElement(dom, "/PcdEntry/Token"))\r
-        self.TokenSpace = XmlElementData(XmlElement(dom, "/PcdEntry/TokenSpaceGuidCName"))\r
-        self.DatumType  = XmlElementData(XmlElement(dom, "/PcdEntry/DatumType"))\r
-        self.Default    = XmlElementData(XmlElement(dom, "/PcdEntry/DefaultValue"))\r
+        self.Types      = XmlElementData(XmlNode(dom, "/PcdEntry/ValidUsage")).split()\r
+        self.CName      = XmlElementData(XmlNode(dom, "/PcdEntry/C_Name"))\r
+        self.Token      = XmlElementData(XmlNode(dom, "/PcdEntry/Token"))\r
+        self.TokenSpace = XmlElementData(XmlNode(dom, "/PcdEntry/TokenSpaceGuidCName"))\r
+        self.DatumType  = XmlElementData(XmlNode(dom, "/PcdEntry/DatumType"))\r
+        self.Default    = XmlElementData(XmlNode(dom, "/PcdEntry/DefaultValue"))\r
         self.Archs      = self.GetArchList(dom)\r
         self.ModuleTypes= self.GetModuleTypeList(dom)\r
 \r
@@ -566,10 +566,10 @@ class PlatformModule(FrameworkElement.PlatformModule, SurfaceAreaElement):
         for lib in libraryList:\r
             self.Libraries.append(LibraryInstance(self._Workspace, self, lib))\r
             \r
-        dom = XmlElement(dom, "/ModuleSA/ModuleSaBuildOptions")\r
-        self.FvBindings = self.GetFvBindingList(XmlElement(dom, "/ModuleSaBuildOptions/FvBinding"))\r
-        self.FfsLayouts = XmlElementData(XmlElement(dom, "/ModuleSaBuildOptions/FfsFormatKey")).split()\r
-        self.BuildOptions = self.GetBuildOptionList(XmlElement(dom, "/ModuleSaBuildOptions/Options"))\r
+        dom = XmlNode(dom, "/ModuleSA/ModuleSaBuildOptions")\r
+        self.FvBindings = self.GetFvBindingList(XmlNode(dom, "/ModuleSaBuildOptions/FvBinding"))\r
+        self.FfsLayouts = XmlElementData(XmlNode(dom, "/ModuleSaBuildOptions/FfsFormatKey")).split()\r
+        self.BuildOptions = self.GetBuildOptionList(XmlNode(dom, "/ModuleSaBuildOptions/Options"))\r
 \r
     def Postprocess(self):\r
         self.Module = self._Workspace.GetModule(self.GuidValue, self.Version,\r
@@ -602,22 +602,22 @@ class ModuleSurfaceArea(FrameworkElement.Module, SurfaceAreaElement):
         SurfaceAreaElement.__init__(self, workspace, package)\r
 \r
     def _MsaHeader(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
-        self.Name = XmlElementData(XmlElement(dom, "/MsaHeader/ModuleName"))\r
-        self.Type = XmlElementData(XmlElement(dom, "/MsaHeader/ModuleType"))\r
-        self.GuidValue = XmlElementData(XmlElement(dom, "/MsaHeader/GuidValue")).upper()\r
-        self.Version = XmlElementData(XmlElement(dom, "/MsaHeader/Version"))\r
+        self.Name = XmlElementData(XmlNode(dom, "/MsaHeader/ModuleName"))\r
+        self.Type = XmlElementData(XmlNode(dom, "/MsaHeader/ModuleType"))\r
+        self.GuidValue = XmlElementData(XmlNode(dom, "/MsaHeader/GuidValue")).upper()\r
+        self.Version = XmlElementData(XmlNode(dom, "/MsaHeader/Version"))\r
         \r
     def _ModuleDefinitions(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
-        self.Archs = XmlElementData(XmlElement(dom, "/ModuleDefinitions/SupportedArchitectures")).split()\r
-        self.IsBinary = self.GetBoolean(XmlElement(dom, "/ModuleDefinitions/BinaryModule"))\r
-        self.BaseName = XmlElementData(XmlElement(dom, "/ModuleDefinitions/OutputFileBasename"))\r
+        self.Archs = XmlElementData(XmlNode(dom, "/ModuleDefinitions/SupportedArchitectures")).split()\r
+        self.IsBinary = self.GetBoolean(XmlNode(dom, "/ModuleDefinitions/BinaryModule"))\r
+        self.BaseName = XmlElementData(XmlNode(dom, "/ModuleDefinitions/OutputFileBasename"))\r
         \r
     def _LibraryClassDefinitions(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
         lcList = []\r
         for lc in XmlList(dom, "/LibraryClassDefinitions/LibraryClass"):\r
@@ -625,7 +625,7 @@ class ModuleSurfaceArea(FrameworkElement.Module, SurfaceAreaElement):
         self._Elements["LibraryClassDefinitions"] = lcList\r
 \r
     def _SourceFiles(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
         srcList = []\r
         for f in XmlList(dom, "/SourceFiles/Filename"):\r
@@ -633,13 +633,13 @@ class ModuleSurfaceArea(FrameworkElement.Module, SurfaceAreaElement):
         self._Elements["SourceFiles"] = srcList\r
 \r
     def _NonProcessedFiles(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
         for f in XmlList(dom, "/NonProcessedFiles/Filename"):\r
             self.NonProcessedFiles.append(SourceFile(self._Workspace, self, f))\r
 \r
     def _PackageDependencies(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
         pdList = []\r
         for pkg in XmlList(dom, "/PackageDependencies/Package"):\r
@@ -647,7 +647,7 @@ class ModuleSurfaceArea(FrameworkElement.Module, SurfaceAreaElement):
         self._Elements["PackageDependencies"] = pdList\r
 \r
     def _Protocols(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
     \r
         protocolList = []\r
@@ -659,7 +659,7 @@ class ModuleSurfaceArea(FrameworkElement.Module, SurfaceAreaElement):
         self._Elements["Protocols"] = protocolList\r
 \r
     def _Ppis(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
     \r
         ppiList = []\r
@@ -671,7 +671,7 @@ class ModuleSurfaceArea(FrameworkElement.Module, SurfaceAreaElement):
         self._Elements["PPIs"] = ppiList\r
 \r
     def _Guids(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
         guidList = []\r
         for g in XmlList(dom, "/Guids/GuidCNames"):\r
@@ -679,10 +679,10 @@ class ModuleSurfaceArea(FrameworkElement.Module, SurfaceAreaElement):
         self._Elements["Guids"] = guidList\r
 \r
     def _Externs(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
-        self.PcdIsDriver = self.GetBoolean(XmlElement(dom, "/Externs/PcdIsDriver"))\r
-        self.NeedsFlashMap_h = self.GetBoolean(XmlElement(dom, "/Externs/TianoR8FlashMap_h"))\r
+        self.PcdIsDriver = self.GetBoolean(XmlNode(dom, "/Externs/PcdIsDriver"))\r
+        self.NeedsFlashMap_h = self.GetBoolean(XmlNode(dom, "/Externs/TianoR8FlashMap_h"))\r
 \r
         externList = []\r
         specs = FrameworkElement.Extern()\r
@@ -695,9 +695,9 @@ class ModuleSurfaceArea(FrameworkElement.Module, SurfaceAreaElement):
         self._Elements["Externs"] = externList\r
 \r
     def _ModuleBuildOptions(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
-        self.BuildOptions = self.GetBuildOptionList(XmlElement(dom, "/ModuleBuildOptions/Options"))\r
+        self.BuildOptions = self.GetBuildOptionList(XmlNode(dom, "/ModuleBuildOptions/Options"))\r
 \r
     def _UserExtensions(self, xpath):\r
         domList = XmlList(self._Root, xpath)\r
@@ -837,14 +837,14 @@ class Workspace(FrameworkElement.Workspace, SurfaceAreaElement):
         self.Postprocess()\r
 \r
     def _FdbHeader(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
-        self.Name = XmlElementData(XmlElement(dom, "/FdbHeader/DatabaseName"))\r
-        self.GuidValue = XmlElementData(XmlElement(dom, "/FdbHeader/GuidValue")).upper()\r
-        self.Version = XmlElementData(XmlElement(dom, "/FdbHeader/Version"))\r
+        self.Name = XmlElementData(XmlNode(dom, "/FdbHeader/DatabaseName"))\r
+        self.GuidValue = XmlElementData(XmlNode(dom, "/FdbHeader/GuidValue")).upper()\r
+        self.Version = XmlElementData(XmlNode(dom, "/FdbHeader/Version"))\r
 \r
     def _PackageList(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
     \r
         fileList = XmlList(dom, "/PackageList/Filename")\r
@@ -857,7 +857,7 @@ class Workspace(FrameworkElement.Workspace, SurfaceAreaElement):
         if len(self._Elements["PlatformList"]) > 0:\r
             return\r
         \r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
     \r
         fileList = XmlList(dom, "/PlatformList/Filename")\r
@@ -867,7 +867,7 @@ class Workspace(FrameworkElement.Workspace, SurfaceAreaElement):
         self._Elements["PlatformList"] = platforms\r
 \r
     def _FarList(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
     \r
         fileList = XmlList(dom, "/FarList/Filename")\r
@@ -1199,18 +1199,18 @@ class PackageSurfaceArea(FrameworkElement.Package, SurfaceAreaElement):
         SurfaceAreaElement.__init__(self, workspace, workspace, None, True, True)\r
         \r
     def _SpdHeader(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
-        self.Name = XmlElementData(XmlElement(dom, "/SpdHeader/PackageName"))\r
-        self.GuidValue = XmlElementData(XmlElement(dom, "/SpdHeader/GuidValue")).upper()\r
-        self.Version = XmlElementData(XmlElement(dom, "/SpdHeader/Version"))\r
+        dom = XmlNode(self._Root, xpath)\r
+        self.Name = XmlElementData(XmlNode(dom, "/SpdHeader/PackageName"))\r
+        self.GuidValue = XmlElementData(XmlNode(dom, "/SpdHeader/GuidValue")).upper()\r
+        self.Version = XmlElementData(XmlNode(dom, "/SpdHeader/Version"))\r
 \r
     def _PackageDefinitions(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
-        self.ReadOnly = XmlElementData(XmlElement(dom, "/PackageDefinitions/ReadOnly"))\r
-        self.Repackage = XmlElementData(XmlElement(dom, "/PackageDefinitions/RePackage"))\r
+        dom = XmlNode(self._Root, xpath)\r
+        self.ReadOnly = XmlElementData(XmlNode(dom, "/PackageDefinitions/ReadOnly"))\r
+        self.Repackage = XmlElementData(XmlNode(dom, "/PackageDefinitions/RePackage"))\r
 \r
     def _LibraryClassDeclarations(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         lcdList = XmlList(dom, "/LibraryClassDeclarations/LibraryClass")\r
         lcds = []\r
         for lc in lcdList:\r
@@ -1218,7 +1218,7 @@ class PackageSurfaceArea(FrameworkElement.Package, SurfaceAreaElement):
         self._Elements["LibraryClassDeclarations"] = lcds\r
         \r
     def _IndustryStdIncludes(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         headerList = XmlList(dom, "/IndustryStdIncludes/IndustryStdHeader")\r
         headers = []\r
         for h in headerList:\r
@@ -1226,7 +1226,7 @@ class PackageSurfaceArea(FrameworkElement.Package, SurfaceAreaElement):
         self._Elements["IndustryStdIncludes"] = headers\r
         \r
     def _MsaFiles(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         msaFileList = XmlList(dom, "/MsaFiles/Filename")\r
         msaFiles = []\r
         for msa in msaFileList:\r
@@ -1235,7 +1235,7 @@ class PackageSurfaceArea(FrameworkElement.Package, SurfaceAreaElement):
         self._Elements["MsaFiles"] = msaFiles\r
 \r
     def _PackageHeaders(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         headerList = XmlList(dom, "/PackageHeaders/IncludePkgHeader")\r
         headers = []\r
         for h in headerList:\r
@@ -1243,7 +1243,7 @@ class PackageSurfaceArea(FrameworkElement.Package, SurfaceAreaElement):
         self._Elements["PackageHeaders"] = headers\r
 \r
     def _GuidDeclarations(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         guidList = XmlList(dom, "/GuidDeclarations/Entry")\r
         guids = []\r
         for guid in guidList:\r
@@ -1251,7 +1251,7 @@ class PackageSurfaceArea(FrameworkElement.Package, SurfaceAreaElement):
         self._Elements["GuidDeclarations"] = guids\r
             \r
     def _ProtocolDeclarations(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         protocolList = XmlList(dom, "/ProtocolDeclarations/Entry")\r
         protocols = []\r
         for p in protocolList:\r
@@ -1259,7 +1259,7 @@ class PackageSurfaceArea(FrameworkElement.Package, SurfaceAreaElement):
         self._Elements["ProtocolDeclarations"] = protocols\r
 \r
     def _PpiDeclarations(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         ppiList = XmlList(dom, "/PpiDeclarations/Entry")\r
         ppis = []\r
         for p in ppiList:\r
@@ -1267,7 +1267,7 @@ class PackageSurfaceArea(FrameworkElement.Package, SurfaceAreaElement):
         self._Elements["PpiDeclarations"] = ppis\r
 \r
     def _PcdDeclarations(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         pcdList = XmlList(dom, "/PcdDeclarations/PcdEntry")\r
         pcds = []\r
         for p in pcdList:\r
@@ -1339,27 +1339,27 @@ class PlatformSurfaceArea(FrameworkElement.Platform, SurfaceAreaElement):
         SurfaceAreaElement.__init__(self, workspace)\r
         \r
     def _PlatformHeader(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
-        self.Name = XmlElementData(XmlElement(dom, "/PlatformHeader/PlatformName"))\r
-        self.GuidValue = XmlElementData(XmlElement(dom, "/PlatformHeader/GuidValue")).upper()\r
-        self.Version = XmlElementData(XmlElement(dom, "/PlatformHeader/Version"))\r
+        self.Name = XmlElementData(XmlNode(dom, "/PlatformHeader/PlatformName"))\r
+        self.GuidValue = XmlElementData(XmlNode(dom, "/PlatformHeader/GuidValue")).upper()\r
+        self.Version = XmlElementData(XmlNode(dom, "/PlatformHeader/Version"))\r
 \r
     def _PlatformDefinitions(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
-        self.Archs = XmlElementData(XmlElement(dom, "/PlatformDefinitions/SupportedArchitectures")).split()\r
+        self.Archs = XmlElementData(XmlNode(dom, "/PlatformDefinitions/SupportedArchitectures")).split()\r
         if self.Archs == []:\r
             raise Exception("No ARCH specified in platform " + self.Path)\r
-        self.Targets = XmlElementData(XmlElement(dom, "/PlatformDefinitions/BuildTargets")).split()\r
-        self.OutputPath = os.path.normpath(XmlElementData(XmlElement(dom, "/PlatformDefinitions/OutputDirectory")))\r
+        self.Targets = XmlElementData(XmlNode(dom, "/PlatformDefinitions/BuildTargets")).split()\r
+        self.OutputPath = os.path.normpath(XmlElementData(XmlNode(dom, "/PlatformDefinitions/OutputDirectory")))\r
 \r
     def _Flash(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
 \r
     def _FrameworkModules(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
         moduleList = XmlList(dom, "/FrameworkModules/ModuleSA")\r
         modules = []\r
@@ -1368,13 +1368,13 @@ class PlatformSurfaceArea(FrameworkElement.Platform, SurfaceAreaElement):
         self._Elements["FrameworkModules"] = modules\r
 \r
     def _DynamicPcdBuildDefinitions(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
 \r
     def _BuildOptions(self, xpath):\r
-        dom = XmlElement(self._Root, xpath)\r
+        dom = XmlNode(self._Root, xpath)\r
         if dom == '': return\r
-        self.BuildOptions = self.GetBuildOptionList(XmlElement(dom, "/BuildOptions/Options"))\r
+        self.BuildOptions = self.GetBuildOptionList(XmlNode(dom, "/BuildOptions/Options"))\r
         # print self.BuildOptions\r
 \r
     def _UserExtensions(self, xpath):\r
@@ -1519,6 +1519,7 @@ def PrintWorkspace(ws):
 if __name__ == "__main__":\r
     # os.environ["WORKSPACE"]\r
     workspacePath = os.getenv("WORKSPACE", os.getcwd())\r
+    workspacePath = "C:\\home\\src\\R9\\pbuild"\r
     saFile = ""\r
     if len(sys.argv) <= 1:\r
         saFile = os.path.join(workspacePath, "Tools/Conf/FrameworkDatabase.db")\r
@@ -1529,16 +1530,6 @@ if __name__ == "__main__":
 \r
     startTime = time.clock()\r
     sa = Workspace(workspacePath, [], [])\r
-##    dbak = None\r
-##    if os.path.exists("workspace.bak"):\r
-##        dbak = shelve.open("workspace.bak", protocol=2)\r
-##        sa = dbak.db\r
-##        dbak.close()\r
-##    else:\r
-##        sa = FrameworkDatabase(saFile)\r
-##        dbak = shelve.open("workspace.bak", protocol=2)\r
-##        dbak.db = sa\r
-##        dbak.close()\r
     # sa = PackageSurfaceArea(saFile)\r
     # sa = PlatformSurfaceArea(saFile)\r
     # sa = ModuleSurfaceArea(saFile)\r