I want to write a RSS reader in metro style, below is one of functions in my app.
function btnOKClick() {
var btnOK = document.getElementById("btnOK");
var txtAddress = document.getElementById("rssAddress");
WinJS.xhr({ url: txtAddress.value }).done(function (result) {
var xml = result.responseXML;
//xml.selectSingleNode();
});
But I can't find selectSingleNode method in my xml variable. Any one can help?
Apparently the selectSingleNode
method was available up through the Consumer Preview release but was removed in later builds because, as Kraig Brockschmidt puts it:
...the underlying object type of the
request.responseXML
was changed, and that object has its own API. Before it was an XML DOM object (out of the MSXML library), but it was changed to an HTML DOM object, hence the change in methods and properties.
In the same post, Kraig gives the new alternative to selectSingleNode
:
you need to use
querySelector
instead ofselectNodes
...It should be now something like:
var categories = request.responseXML.querySelectorAll("entry");