You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/04/25 22:58:50 UTC

git commit: CB-6450 added support for local XHR.responseXML getter

Repository: cordova-wp8
Updated Branches:
  refs/heads/master 30fba4235 -> 67715e029


CB-6450 added support for local XHR.responseXML getter


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

Branch: refs/heads/master
Commit: 67715e0294c362a0ee9585ec8165d47a95fc4964
Parents: 30fba42
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Apr 25 13:58:35 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Apr 25 13:58:35 2014 -0700

----------------------------------------------------------------------
 wp7/template/cordovalib/XHRHelper.cs | 5 +++++
 wp8/template/cordovalib/XHRHelper.cs | 5 +++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/67715e02/wp7/template/cordovalib/XHRHelper.cs
----------------------------------------------------------------------
diff --git a/wp7/template/cordovalib/XHRHelper.cs b/wp7/template/cordovalib/XHRHelper.cs
index 0e3a5e9..e2d4593 100644
--- a/wp7/template/cordovalib/XHRHelper.cs
+++ b/wp7/template/cordovalib/XHRHelper.cs
@@ -226,6 +226,11 @@ namespace WPCordovaClassLib.CordovaLib
                             alias.status = responseCode;
                             if (responseCode == '200') {
                                 alias.responseText = responseText;
+                                Object.defineProperty(alias, 'responseXML', {
+                                    get: function () {
+                                        return new DOMParser().parseFromString(this.responseText, 'text/xml');
+                                    }
+                                });
                             }
                             else {
                                 alias.onerror && alias.onerror(responseCode);

http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/67715e02/wp8/template/cordovalib/XHRHelper.cs
----------------------------------------------------------------------
diff --git a/wp8/template/cordovalib/XHRHelper.cs b/wp8/template/cordovalib/XHRHelper.cs
index 0e3a5e9..e2d4593 100644
--- a/wp8/template/cordovalib/XHRHelper.cs
+++ b/wp8/template/cordovalib/XHRHelper.cs
@@ -226,6 +226,11 @@ namespace WPCordovaClassLib.CordovaLib
                             alias.status = responseCode;
                             if (responseCode == '200') {
                                 alias.responseText = responseText;
+                                Object.defineProperty(alias, 'responseXML', {
+                                    get: function () {
+                                        return new DOMParser().parseFromString(this.responseText, 'text/xml');
+                                    }
+                                });
                             }
                             else {
                                 alias.onerror && alias.onerror(responseCode);