cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [20/50] [abbrv] git commit: [CB-4807] Handle config.xml namespaces
Date Fri, 01 Nov 2013 01:27:15 GMT
[CB-4807] Handle config.xml namespaces


Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/7944b671
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/7944b671
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/7944b671

Branch: refs/heads/2.9.x
Commit: 7944b671cb8a745b0775436a247a9b472eec8dbc
Parents: 9976c02
Author: purplecabbage <purplecabbage@gmail.com>
Authored: Fri Sep 13 14:19:27 2013 -0700
Committer: purplecabbage <purplecabbage@gmail.com>
Committed: Fri Sep 13 14:19:27 2013 -0700

----------------------------------------------------------------------
 wp7/template/cordovalib/ConfigHandler.cs | 19 +++++++++++++------
 wp8/template/cordovalib/ConfigHandler.cs | 19 +++++++++++++------
 2 files changed, 26 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/7944b671/wp7/template/cordovalib/ConfigHandler.cs
----------------------------------------------------------------------
diff --git a/wp7/template/cordovalib/ConfigHandler.cs b/wp7/template/cordovalib/ConfigHandler.cs
index 0342930..05829b5 100644
--- a/wp7/template/cordovalib/ConfigHandler.cs
+++ b/wp7/template/cordovalib/ConfigHandler.cs
@@ -181,13 +181,15 @@ namespace WPCordovaClassLib.CordovaLib
 
         private void LoadPluginFeatures(XDocument document)
         {
-            var features = document.Descendants("feature");
+            var features = from f in document.Descendants()
+                           where f.Name.LocalName == "feature"
+                           select f;
 
             foreach (var feature in features)
             {
                 var name = feature.Attribute("name");
-                var values = from results in feature.Descendants("param")
-                             where ((string)results.Attribute("name") == "wp-package")
+                var values = from results in feature.Descendants()
+                             where results.Name.LocalName == "param" && ((string)results.Attribute("name")
== "wp-package")
                              select results;
 
                 var value = values.FirstOrDefault();
@@ -214,7 +216,8 @@ namespace WPCordovaClassLib.CordovaLib
 
                 LoadPluginFeatures(document);
 
-                var preferences = from results in document.Descendants("preference")
+                var preferences = from results in document.Descendants()
+                                  where results.Name.LocalName == "preference"
                                   select new
                                   {
                                       name = (string)results.Attribute("name"),
@@ -227,7 +230,8 @@ namespace WPCordovaClassLib.CordovaLib
                     Debug.WriteLine("pref" + pref.name + ", " + pref.value);
                 }
 
-                var accessList = from results in document.Descendants("access")
+                var accessList = from results in document.Descendants()
+                                 where results.Name.LocalName == "access"
                                  select new
                                  {
                                      origin = (string)results.Attribute("origin"),
@@ -239,7 +243,10 @@ namespace WPCordovaClassLib.CordovaLib
                     AddWhiteListEntry(accessElem.origin, accessElem.subdomains);
                 }
 
-                var contentsTag = document.Descendants("content").FirstOrDefault();
+                var contentsTag = (from results in document.Descendants()
+                                  where results.Name.LocalName == "content"
+                                  select results).FirstOrDefault();
+
                 if (contentsTag != null)
                 {
                     var src = contentsTag.Attribute("src");

http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/7944b671/wp8/template/cordovalib/ConfigHandler.cs
----------------------------------------------------------------------
diff --git a/wp8/template/cordovalib/ConfigHandler.cs b/wp8/template/cordovalib/ConfigHandler.cs
index 5c81797..fcb8665 100644
--- a/wp8/template/cordovalib/ConfigHandler.cs
+++ b/wp8/template/cordovalib/ConfigHandler.cs
@@ -170,13 +170,15 @@ namespace WPCordovaClassLib.CordovaLib
 
         private void LoadPluginFeatures(XDocument document)
         {
-            var features = document.Descendants("feature");
+            var features = from feats in document.Descendants()
+                           where feats.Name.LocalName == "feature"
+                           select feats;
 
             foreach (var feature in features)
             {
                 var name = feature.Attribute("name");
-                var values = from results in feature.Descendants("param")
-                             where ((string)results.Attribute("name") == "wp-package")
+                var values = from results in feature.Descendants()
+                             where results.Name.LocalName == "param" && ((string)results.Attribute("name")
== "wp-package")
                              select results;
 
                 var value = values.FirstOrDefault();
@@ -203,7 +205,8 @@ namespace WPCordovaClassLib.CordovaLib
 
                 LoadPluginFeatures(document);
 
-                var preferences = from results in document.Descendants("preference")
+                var preferences = from results in document.Descendants()
+                                  where results.Name.LocalName == "preference"
                                   select new
                                   {
                                       name = (string)results.Attribute("name"),
@@ -216,7 +219,8 @@ namespace WPCordovaClassLib.CordovaLib
                     Debug.WriteLine("pref" + pref.name + ", " + pref.value);
                 }
 
-                var accessList = from results in document.Descendants("access")
+                var accessList = from results in document.Descendants()
+                                 where results.Name.LocalName == "access"
                                  select new
                                  {
                                      origin = (string)results.Attribute("origin"),
@@ -228,7 +232,10 @@ namespace WPCordovaClassLib.CordovaLib
                     AddWhiteListEntry(accessElem.origin, accessElem.subdomains);
                 }
 
-                var contentsTag = document.Descendants("content").FirstOrDefault();
+                var contentsTag = (from results in document.Descendants()
+                                   where results.Name.LocalName == "content"
+                                   select results).FirstOrDefault();
+
                 if (contentsTag != null)
                 {
                     var src = contentsTag.Attribute("src");


Mime
View raw message