Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Xdocument Parse XML

$
0
0

Hello.

I did post a XML question a couple of days ago and i have parsed several XML files with the help of the answer in that post XML Post but now i have a XML file that i dont know how to parse.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetTransportInfoResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><CurrentTransportState>PAUSED_PLAYBACK</CurrentTransportState><CurrentTransportStatus>OK</CurrentTransportStatus><CurrentSpeed>1</CurrentSpeed></u:GetTransportInfoResponse></s:Body></s:Envelope>

Iam trying to fetch

<CurrentTransportState>

I dont know what Name Space to use, I have tried many different approach but it always ends up with no result.

This is one of my attempts

XNamespace test = "urn:schemas-upnp org:service:AVTransport:1";
var currentstate = xdoc.Descendants(test + "CurrentTransportState");


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>