http://rtt.metroinfo.org.nz/RTT/Public/Utility/File.aspx?ContentType=SQLXML&Name=JPPlatform.xml
Both of those are my sample data which I am pulling down using HttpClient, I want to grab the attributes(?) such as PlatformTag
, ETA
and the like.
This is using Univeral Apps for Windows 10 mobile and Desktop. But I can't figure out what's going on to do it.
XDocument Document = XDocument.Parse(RESPONSE_CONSTANT);
var Stops = from Stop in Document.Descendants("Platform")
select new
{
Platformtag = (string)Stop.Attribute("PlatformTag"),
Platformno = (string)Stop.Attribute("PlatformNo")};
foreach (var item in Stops)
BusData.Text = item.Platformtag;
}
Is what I currently have, but nothing comes from it, it just sits there like it sees nothing, from here I don't know enough about XML Parsing to find a next step.
Note: Response_Constant contains data like this: http://rtt.metroinfo.org.nz/RTT/Public/Utility/File.aspx?Name=JPRoutePositionET.xml&ContentType=SQLXML&PlatformTag=536