c# - How Can I Use XMLDocument.SelectNodes in UWP -
i beginner in programming uwp applications, know c#. question is, how use selectnodes in uwp applications since definition doesn't exist... how work around issue? thanks.
here code if needed
xmldocument responsexml = new xmldocument(); responsexml.loadxml(response); string innertext = responsexml.selectnodes("//maininfo").item(0).innertext; responsexml.loadxml(innertext); info1 = responsexml.getelementsbytagname("upnp:info1").item(0).innertext; info2 = responsexml.getelementsbytagname("upnp:info2").item(0).innertext; info3 = responsexml.getelementsbytagname("dc:info3").item(0).innertext; info4 = responsexml.getelementsbytagname("dc:info4").item(0).innertext;
how use selectnodes in uwp applications since definition doesn't exist... how work around issue?
the problem have used wrong namespace(system.xml
) xmldocument
. please use windows.data.xml.dom
namespace. more refer xmldocument
class official documentation.
using windows.data.xml.dom; ...... xmldocument responsexml = new xmldocument(); responsexml.loadxml(response); string innertext = responsexml.selectnodes("//maininfo").item(0).innertext;
here official xml dom sample, please check.
Comments
Post a Comment