added the support for new schema and old schema at the same time
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Jun 2006 10:44:45 +0000 (10:44 +0000)
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Jun 2006 10:44:45 +0000 (10:44 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@510 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java
Tools/Source/GenBuild/org/tianocore/build/global/OverrideProcess.java
Tools/Source/GenBuild/org/tianocore/build/global/Spd.java
Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaParser.java
Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java

index 2d3318d..5ee07fb 100644 (file)
@@ -1063,10 +1063,13 @@ public class GenBuildTask extends Task {
         getProject().setProperty("SDB_FILES", "");\r
         getProject().setProperty("BASE_NAME", baseName);\r
         if (map.get("MsaHeader") != null) {\r
-            flag = GlobalData.MSA_AND_MBD;\r
-            MsaHeaderDocument.MsaHeader header = ((MsaHeaderDocument) map.get("MsaHeader")).getMsaHeader();\r
-            guid = header.getGuid().getStringValue();\r
-            componentType = header.getComponentType().toString();\r
+            guid = SurfaceAreaQuery.getModuleGuid();//header.getGuid().getStringValue();\r
+            componentType = SurfaceAreaQuery.getComponentType();//header.getComponentType().toString();\r
+            if (!componentType.equalsIgnoreCase("LIBRARY")) {\r
+                flag = GlobalData.MSA_AND_MBD;\r
+            } else {\r
+                flag = GlobalData.LIBMSA_AND_LIBMBD;\r
+            }\r
         } \r
         \r
         else if (map.get("MsaLibHeader") != null) {\r
@@ -1080,7 +1083,7 @@ public class GenBuildTask extends Task {
         if (componentType != null) {\r
             getProject().setProperty("COMPONENT_TYPE", componentType);\r
         }\r
-        \r
+\r
         if (guid != null) {\r
             getProject().setProperty("FILE_GUID", guid);\r
         }\r
index 011e13d..21197b5 100644 (file)
@@ -352,6 +352,7 @@ public class FpdParserTask extends Task {
             }\r
             Map<String, XmlObject> msaMap = GlobalData.getNativeMsa(baseName);\r
             Map<String, XmlObject> mbdMap = GlobalData.getNativeMbd(baseName);\r
+            Map<String, XmlObject> fpdMap = new HashMap<String, XmlObject>();\r
             Map<String, XmlObject> map = new HashMap<String, XmlObject>();\r
             //\r
             // Whether the Module SA has parsed before or not\r
@@ -363,9 +364,13 @@ public class FpdParserTask extends Task {
                 // Here we can also put platform Build override\r
                 //\r
                 map = op.override(mbdMap, msaMap);\r
-                Map<String, XmlObject> overrideMap = op.override(\r
-                                getPlatformOverrideInfo(moduleSAs[i]),\r
-                                OverrideProcess.deal(map));\r
+                fpdMap = getPlatformOverrideInfo(moduleSAs[i]);\r
+                XmlObject buildOption = (XmlObject)fpdMap.get("BuildOptions");\r
+                buildOption = (XmlObject)fpdMap.get("PackageDependencies");\r
+                buildOption = (XmlObject)fpdMap.get("BuildOptions");\r
+                buildOption = op.override(buildOption, platformBuildOptions);\r
+                fpdMap.put("BuildOptions", ((BuildOptionsDocument)buildOption).getBuildOptions());\r
+                Map<String, XmlObject> overrideMap = op.override(fpdMap, OverrideProcess.deal(map));\r
                 GlobalData.registerModule(baseName, overrideMap);\r
             } else {\r
                 map = GlobalData.getDoc(baseName);\r
@@ -460,6 +465,7 @@ public class FpdParserTask extends Task {
         Map<String, XmlObject> map = new HashMap<String, XmlObject>();\r
         map.put("SourceFiles", sa.getSourceFiles());\r
         map.put("Includes", sa.getIncludes());\r
+        map.put("PackageDependencies", null);\r
         map.put("Libraries", sa.getLibraries());\r
         map.put("Protocols", sa.getProtocols());\r
         map.put("Events", sa.getEvents());\r
@@ -472,7 +478,7 @@ public class FpdParserTask extends Task {
         map.put("Formsets", sa.getFormsets());\r
         map.put("Guids", sa.getGuids());\r
         map.put("Externs", sa.getExterns());\r
-        map.put("BuildOptions", platformBuildOptions);\r
+        map.put("BuildOptions", sa.getBuildOptions());//platformBuildOptions);\r
         return map;\r
     }\r
 \r
index e457d6d..bc2e359 100644 (file)
@@ -17,6 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 package org.tianocore.build.global;\r
 \r
 import java.io.File;\r
+import java.util.ArrayList;\r
 import java.util.HashMap;\r
 import java.util.HashSet;\r
 import java.util.Iterator;\r
@@ -26,15 +27,18 @@ import java.util.Set;
 \r
 import org.apache.tools.ant.BuildException;\r
 import org.apache.xmlbeans.XmlObject;\r
+import org.tianocore.FilenameDocument;\r
+import org.tianocore.FilenameDocument.Filename;\r
 import org.tianocore.FrameworkDatabaseDocument;\r
 import org.tianocore.MsaFilesDocument;\r
-import org.tianocore.PackageListDocument;\r
-import org.tianocore.PackageSurfaceAreaDocument;\r
+import org.tianocore.MsaFilesDocument.MsaFiles.MsaFile;\r
 import org.tianocore.MsaHeaderDocument.MsaHeader;\r
 import org.tianocore.MsaLibHeaderDocument.MsaLibHeader;\r
-import org.tianocore.build.pcd.entity.MemoryDatabaseManager;\r
+import org.tianocore.PackageListDocument;\r
+import org.tianocore.PackageSurfaceAreaDocument;\r
 import org.tianocore.build.autogen.CommonDefinition;\r
 import org.tianocore.build.fpd.FpdParserTask;\r
+import org.tianocore.build.pcd.entity.MemoryDatabaseManager;\r
 \r
 /**\r
   GlobalData provide initializing, instoring, querying and update global data.\r
@@ -291,27 +295,44 @@ public class GlobalData {
         File packageFile = new File(packageFilename);\r
         try {\r
             PackageSurfaceAreaDocument spd = (PackageSurfaceAreaDocument) XmlObject.Factory.parse(packageFile);\r
+            List<FilenameDocument.Filename> msaFilenameList;\r
+\r
             List<MsaFilesDocument.MsaFiles.MsaFile> msasList = spd.getPackageSurfaceArea().getMsaFiles()\r
                                                                   .getMsaFileList();\r
-            Iterator msasIter = msasList.iterator();\r
-            while (msasIter.hasNext()) {\r
-                MsaFilesDocument.MsaFiles.MsaFile msas = (MsaFilesDocument.MsaFiles.MsaFile) msasIter.next();\r
-                String msaFilename = msas.getFilename().getStringValue();\r
+            if (msasList.size() == 0) {\r
+                msaFilenameList = spd.getPackageSurfaceArea().getMsaFiles().getFilenameList();\r
+            } else {\r
+                msaFilenameList = new ArrayList<FilenameDocument.Filename>(msasList.size());\r
+                Iterator msasIter = msasList.iterator();\r
+                while (msasIter.hasNext()) {\r
+                    MsaFilesDocument.MsaFiles.MsaFile msaFile = (MsaFilesDocument.MsaFiles.MsaFile)msasIter.next();\r
+                    msaFilenameList.add(msaFile.getFilename());\r
+                }\r
+            }\r
+\r
+            Iterator msaFilenameIter = msaFilenameList.iterator();\r
+            while (msaFilenameIter.hasNext()) {\r
+                FilenameDocument.Filename msaFilename = (FilenameDocument.Filename)msaFilenameIter.next();\r
+                String filename = msaFilename.getStringValue();\r
                 File msaFile = new File(workspaceDir + File.separatorChar + GlobalData.getPackagePath(packageName)\r
-                                        + File.separatorChar + msaFilename);\r
+                                        + File.separatorChar + filename);\r
                 SurfaceAreaParser surfaceAreaParser = new SurfaceAreaParser();\r
                 Map<String, XmlObject> map = surfaceAreaParser.parseFile(msaFile);\r
                 String baseName = "";\r
                 XmlObject header = null;\r
                 if ((header = map.get("MsaHeader")) != null) {\r
-                    baseName = ((MsaHeader) header).getBaseName().getStringValue();\r
+                    if (((MsaHeader) header).isSetBaseName()) {\r
+                        baseName = ((MsaHeader) header).getBaseName().getStringValue();\r
+                    } else {\r
+                        baseName = ((MsaHeader) header).getModuleName();\r
+                    }\r
                 } else if ((header = map.get("MsaLibHeader")) != null) {\r
                     baseName = ((MsaLibHeader) header).getBaseName().getStringValue();\r
                 } else {\r
                     continue;\r
                 }\r
                 nativeMsa.put(baseName, map);\r
-                String[] info = { msaFilename, packageName };\r
+                String[] info = { filename, packageName };\r
                 moduleInfo.put(baseName, info);\r
             }\r
         } catch (Exception e) {\r
@@ -472,7 +493,8 @@ public class GlobalData {
         String mbdFilename = getMbdFilename(moduleName);\r
         File mbdFile = new File(mbdFilename);\r
         if (!mbdFile.exists()) {\r
-            throw new BuildException("Info: Surface Area file [" + mbdFile.getPath() + "] can't found.");\r
+            return null;\r
+            //throw new BuildException("Info: Surface Area file [" + mbdFile.getPath() + "] can't found.");\r
         }\r
         SurfaceAreaParser surfaceAreaParser = new SurfaceAreaParser();\r
         Map<String, XmlObject> map = surfaceAreaParser.parseFile(mbdFile);\r
index 9354def..60f430f 100644 (file)
@@ -42,6 +42,7 @@ import org.tianocore.ProtocolsDocument;
 import org.tianocore.SourceFilesDocument;\r
 import org.tianocore.SystemTablesDocument;\r
 import org.tianocore.VariablesDocument;\r
+import org.tianocore.PackageDependenciesDocument;\r
 \r
 /**\r
   This class is used to override surface area information. For example, MBD can\r
@@ -110,7 +111,7 @@ public class OverrideProcess {
     /// list of top elements of surface area\r
     ///\r
     public static String[] topElements = { "LibraryClassDefinitions",\r
-                    "SourceFiles", "Includes", "Libraries", "Protocols",\r
+                    "SourceFiles", "Includes", "PackageDependencies", "Libraries", "Protocols",\r
                     "Events", "Hobs", "PPIs", "Variables", "BootModes",\r
                     "SystemTables", "DataHubs", "Formsets", "Guids", "Externs",\r
                     "PcdCoded", "BuildOptions" };\r
@@ -178,6 +179,10 @@ public class OverrideProcess {
             newMap.put("Includes", ((IncludesDocument) map.get("Includes"))\r
                             .getIncludes());\r
         }\r
+        if (map.get("PackageDependencies") != null) {\r
+            newMap.put("PackageDependencies", ((PackageDependenciesDocument) map.get("PackageDependencies"))\r
+                            .getPackageDependencies());\r
+        }\r
         if (map.get("Libraries") != null) {\r
             newMap.put("Libraries", ((LibrariesDocument) map.get("Libraries"))\r
                             .getLibraries());\r
@@ -285,8 +290,11 @@ public class OverrideProcess {
         result.put("MsaHeader", override(l.get("MsaHeader"), null));\r
         result.put("MsaLibHeader", override(l.get("MsaLibHeader"), null));\r
         for (int i = 0; i < topElements.length; i++) {\r
-            result.put(topElements[i], override(h.get(topElements[i]), l\r
-                            .get(topElements[i])));\r
+            if (h != null) {\r
+                result.put(topElements[i], override(h.get(topElements[i]), l.get(topElements[i])));\r
+            } else {\r
+                result.put(topElements[i], override(l.get(topElements[i]), null));\r
+            }\r
         }\r
         return result;\r
     }\r
@@ -310,8 +318,7 @@ public class OverrideProcess {
         }\r
         XmlCursor hc = h.newCursor();\r
         if (h.getClass() != l.getClass()) {\r
-            System.out\r
-                            .println("Error: Two XmlObject does not with compliant format.");\r
+            System.out.println("Error: Two XmlObject does not with compliant format.");\r
             return null;\r
         }\r
         if (!hc.toFirstChild()) {\r
index 54c1391..72efa7e 100644 (file)
@@ -18,14 +18,15 @@ import java.util.HashMap;
 import java.util.List;\r
 import java.util.Map;\r
 \r
-import org.tianocore.PackageSurfaceAreaDocument;\r
 import org.tianocore.GuidDeclarationsDocument.GuidDeclarations;\r
 import org.tianocore.IncludeHeaderDocument.IncludeHeader;\r
 import org.tianocore.LibraryClassDeclarationDocument.LibraryClassDeclaration;\r
 import org.tianocore.LibraryClassDeclarationsDocument.LibraryClassDeclarations;\r
 import org.tianocore.PackageHeadersDocument.PackageHeaders;\r
+import org.tianocore.PackageSurfaceAreaDocument;\r
 import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;\r
 import org.tianocore.PpiDeclarationsDocument.PpiDeclarations;\r
+import org.tianocore.PpiDeclarationsDocument.PpiDeclarations.Entry;\r
 import org.tianocore.ProtocolDeclarationsDocument.ProtocolDeclarations;\r
 \r
 /**\r
@@ -125,15 +126,14 @@ public class Spd {
 \r
         if (packageHeader != null) {\r
             List<IncludeHeader> headerList = packageHeader.getIncludeHeaderList();\r
+            IncludeHeader       header;\r
+\r
             for (int i = 0; i < headerList.size(); i++) {\r
+                header = (IncludeHeader)headerList.get(i);\r
                 try {\r
-                    this.moduleInfo\r
-                                    .put(headerList.get(i).getModuleType()\r
-                                                    .toString(), headerList.get(i)\r
-                                                    .getStringValue());\r
+                    this.moduleInfo.put(header.getModuleType().toString(), header.getStringValue());\r
                 } catch (Exception e) {\r
-                    System.out\r
-                                    .print("can't find ModuleHeaders ModuleType & includeHeader!\n");\r
+                    System.out.print("can't find ModuleHeaders ModuleType & includeHeader!\n");\r
                 }\r
             }\r
         }\r
@@ -149,19 +149,26 @@ public class Spd {
   **/\r
     public void genPpiInfoList(PpiDeclarations ppiInfo) {\r
         String[] cNameGuid = new String[2];\r
+        String   guidString;\r
 \r
         if (ppiInfo != null) {\r
             List<PpiDeclarations.Entry> ppiEntryList = ppiInfo.getEntryList();\r
+            PpiDeclarations.Entry       ppiEntry;\r
+\r
             for (int i = 0; i < ppiEntryList.size(); i++) {\r
+                ppiEntry = (PpiDeclarations.Entry)ppiEntryList.get(i);\r
                 try {\r
-                    cNameGuid[0] = ppiEntryList.get(i).getCName();\r
-                    cNameGuid[1] = formatGuidName(ppiEntryList.get(i)\r
-                                    .getGuid().getStringValue());\r
-                    this.ppiInfo.put(ppiEntryList.get(i).getName(), new String[] {\r
-                                    cNameGuid[0], cNameGuid[1] });\r
+                    if (ppiEntry.isSetGuidValue()) {\r
+                        guidString = ppiEntry.getGuidValue();\r
+                    } else {\r
+                        guidString = ppiEntry.getGuid().getStringValue();\r
+                    }\r
+\r
+                    cNameGuid[0] = ppiEntry.getCName();\r
+                    cNameGuid[1] = formatGuidName(guidString);\r
+                    this.ppiInfo.put(ppiEntry.getName(), new String[] { cNameGuid[0], cNameGuid[1] });\r
                 } catch (Exception e) {\r
-                    System.out\r
-                                    .print("can't find GuidDeclarations C_Name & Guid!\n");\r
+                    System.out.print("can't find GuidDeclarations C_Name & Guid!\n");\r
                 }\r
             }\r
         }\r
@@ -177,20 +184,26 @@ public class Spd {
     **/\r
     public void genProtocolInfoList(ProtocolDeclarations proInfo) {\r
         String[] cNameGuid = new String[2];\r
+        String   guidString;\r
+\r
         if (proInfo != null) {\r
             List<ProtocolDeclarations.Entry> protocolEntryList = proInfo.getEntryList();\r
+            ProtocolDeclarations.Entry       protocolEntry;\r
             for (int i = 0; i < protocolEntryList.size(); i++) {\r
+                protocolEntry = (ProtocolDeclarations.Entry)protocolEntryList.get(i);\r
                 try {\r
-                    cNameGuid[0] = protocolEntryList.get(i).getCName();\r
-                    cNameGuid[1] = formatGuidName(protocolEntryList.get(i)\r
-                                    .getGuid().getStringValue());\r
-\r
-                    String temp = new String(protocolEntryList.get(i).getName());\r
-                    this.protocolInfo.put(temp, new String[] { cNameGuid[0],\r
-                                    cNameGuid[1] });\r
+                    if (protocolEntry.isSetGuidValue()) {\r
+                        guidString = protocolEntry.getGuidValue();\r
+                    } else {\r
+                        guidString = protocolEntry.getGuid().getStringValue();\r
+                    }\r
+                    cNameGuid[0] = protocolEntry.getCName();\r
+                    cNameGuid[1] = formatGuidName(guidString);\r
+\r
+                    String temp = new String(protocolEntry.getName());\r
+                    this.protocolInfo.put(temp, new String[] { cNameGuid[0], cNameGuid[1] });\r
                 } catch (Exception e) {\r
-                    System.out\r
-                                    .print("can't find ProtocolDeclarations C_Name & Guid!\n");\r
+                    System.out.print("can't find ProtocolDeclarations C_Name & Guid!\n");\r
                 }\r
             }\r
         }\r
@@ -207,15 +220,23 @@ public class Spd {
     **/\r
     public void genGuidInfoList(GuidDeclarations guidInfo) {\r
         String[] cNameGuid = new String[2];\r
+        String   guidString;\r
+\r
         if (guidInfo != null) {\r
             \r
-            List<GuidDeclarations.Entry> guidEntryList = guidInfo.getEntryList();\r
+            List<GuidDeclarations.Entry>    guidEntryList = guidInfo.getEntryList();\r
+            GuidDeclarations.Entry          guidEntry;\r
             for (int i = 0; i < guidEntryList.size(); i++) {\r
-                cNameGuid[0] = guidEntryList.get(i).getCName();\r
-                cNameGuid[1] = formatGuidName(guidEntryList.get(i)\r
-                                .getGuid().getStringValue());\r
-                this.guidInfo.put(guidEntryList.get(i).getName(), new String[] {\r
-                                cNameGuid[0], cNameGuid[1] });\r
+                guidEntry = (GuidDeclarations.Entry)guidEntryList.get(i);\r
+                if (guidEntry.isSetGuidValue()) {\r
+                    guidString = guidEntry.getGuidValue();\r
+                } else {\r
+                    guidString = guidEntry.getGuid().getStringValue();\r
+                }\r
+                    \r
+                cNameGuid[0] = guidEntry.getCName();\r
+                cNameGuid[1] = formatGuidName(guidString);\r
+                this.guidInfo.put(guidEntry.getName(), new String[] {cNameGuid[0], cNameGuid[1] });\r
             }\r
         }\r
     }\r
index a2780e6..229e169 100644 (file)
@@ -83,6 +83,7 @@ public class SurfaceAreaParser {
                         .getLibraryClassDefinitions());\r
         msaMap.put("SourceFiles", doc.getModuleSurfaceArea().getSourceFiles());\r
         msaMap.put("Includes", doc.getModuleSurfaceArea().getIncludes());\r
+        msaMap.put("PackageDependencies", doc.getModuleSurfaceArea().getPackageDependencies());\r
         msaMap.put("Protocols", doc.getModuleSurfaceArea().getProtocols());\r
 \r
         msaMap.put("Events", doc.getModuleSurfaceArea().getEvents());\r
index ed6d0a2..50345c8 100644 (file)
@@ -44,6 +44,8 @@ import org.tianocore.PPIsDocument;
 import org.tianocore.PackageNameDocument;\r
 import org.tianocore.ProtocolsDocument;\r
 import org.tianocore.PcdCodedDocument.PcdCoded;\r
+import org.tianocore.MsaHeaderDocument;\r
+import org.tianocore.MsaHeaderDocument.MsaHeader;\r
 \r
 /**\r
   SurfaceAreaQuery class is used to query Surface Area information from msa, mbd,\r
@@ -233,7 +235,8 @@ public class SurfaceAreaQuery {
                 };\r
         } else {\r
             xPath = new String[] {\r
-                "/Filename[not(@ArchType) or @ArchType='ALL' or @ArchType='" + arch + "']",\r
+                "/Filename[not(@SupArchList) and not(@ArchType) or @SupArchList='ALL' or @SupArchList='" + arch + "' or @ArchType='ALL' or @ArchType='" + arch + "']",\r
+                "/Filename[not(@SupArchList) and not(@ArchType) or @ArchType='ALL' or @ArchType='" + arch + "']",\r
                 "/Arch[@ArchType='ALL' or @ArchType='" + arch + "']/Filename"\r
                 };\r
         }\r
@@ -300,6 +303,7 @@ public class SurfaceAreaQuery {
         } else {\r
             xPath = new String[] {\r
                 "/Option",\r
+                "/Option[@SupArchList='ALL' or @SupArchList='" + arch + "']",\r
                 "/Arch[@ArchType='ALL' or @ArchType='" + arch + "']/Option"\r
                 };\r
         }\r
@@ -341,6 +345,17 @@ public class SurfaceAreaQuery {
         return result;\r
     }\r
     \r
+    public static String getModuleName() {\r
+        String[] xPath = new String[] { "/ModuleName", "/BaseName" };\r
+\r
+        XmlObject[] returns = get(xPath);\r
+        if (returns != null && returns.length > 0) {\r
+            return returns[0].toString();\r
+        }\r
+\r
+        return null;\r
+    }\r
+\r
     /**\r
      Retrieve <xxxHeader>/ModuleType\r
 \r
@@ -396,13 +411,18 @@ public class SurfaceAreaQuery {
         } else {\r
             xPath = new String[] {\r
                 "/PackageName",\r
+                "/PackageName[@SupArchList='ALL' or @SupArchList='" + arch + "']",\r
+                "/PackageName[@Arch='ALL' or @Arch='" + arch + "']",\r
                 "/Arch[@ArchType='ALL' or @ArchType='" + arch + "']/PackageName"\r
                 };\r
         }\r
         \r
         XmlObject[] returns = get("Includes", xPath);\r
         if (returns == null || returns.length == 0) {\r
-            return null;\r
+            returns = get("PackageDependencies", xPath);\r
+            if (returns == null || returns.length == 0) {\r
+                return null;\r
+            }\r
         }\r
 \r
         List<String> packageNames = new ArrayList<String>();\r
@@ -471,12 +491,34 @@ public class SurfaceAreaQuery {
      @returns   null                    if nothing is there\r
      **/\r
     public static String getModuleGuid() {\r
-        String[] xPath = new String[] { "/Guid" };\r
+        String[] xPath = new String[] { "" };\r
 \r
-        XmlObject[] returns = get(xPath);\r
+        XmlObject[] returns = get("MsaHeader", xPath);\r
         if (returns != null && returns.length > 0) {\r
-            GuidDocument.Guid guid = (GuidDocument.Guid) returns[0];\r
-            return guid.getStringValue();\r
+            MsaHeaderDocument.MsaHeader moduleHeader = (MsaHeaderDocument.MsaHeader) returns[0];\r
+            if (moduleHeader.isSetGuid()) {\r
+                return moduleHeader.getGuid().getStringValue();\r
+            } else if (moduleHeader.isSetGuidValue()) {\r
+                return moduleHeader.getGuidValue();\r
+            }\r
+        }\r
+\r
+        return null;\r
+    }\r
+\r
+    /**\r
+     Retrieve module Guid string\r
\r
+     @returns   GUILD string            if elements are found at the known xpath\r
+     @returns   null                    if nothing is there\r
+     **/\r
+    public static String getModuleGuidValue() {\r
+        String[] xPath = new String[] { "" };\r
+\r
+        XmlObject[] returns = get("MsaHeader", xPath);\r
+        if (returns != null && returns.length > 0) {            \r
+            MsaHeaderDocument.MsaHeader moduleHeader = (MsaHeaderDocument.MsaHeader) returns[0];\r
+            return moduleHeader.getGuidValue();\r
         }\r
 \r
         return null;\r
@@ -676,7 +718,8 @@ public class SurfaceAreaQuery {
         }\r
         \r
         xPath = new String[] {\r
-                "/Library" + usageAttribute,\r
+                "/Library" + archAttribute, //usageAttribute,\r
+                "/Library[not(@SupArchList) or @SupArchList='" + arch + "']",\r
                 "/Arch" + archAttribute + "/Library" + usageAttribute\r
                 };\r
 \r
@@ -832,6 +875,11 @@ public class SurfaceAreaQuery {
 \r
         XmlObject[] result = get("FrameworkPlatformDescription", xPath);\r
         if (result == null) {\r
+            xPath = new String[] { "/FrameworkModules/*/ModuleSA" };\r
+            result = get("FrameworkPlatformDescription", xPath);\r
+            if (result != null) {\r
+                return (ModuleSADocument.ModuleSA[]) result;\r
+            }\r
             return new ModuleSADocument.ModuleSA[0];\r
         }\r
 \r