Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7975737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:43:33+00:00 2026-06-04T08:43:33+00:00

I have a feed and this is the XML that I get from the

  • 0

I have a feed and this is the XML that I get from the feed : All i am intrested in is the routename ( and and the content within the nodes

<Route z:Id="i1" xmlns="http://schemas.datacontract.org/2004/07/BusExpress.ClassLibrary" 
xmlns:i="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
<EntityKey z:Id="i2"  
xmlns="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses"  
xmlns:a="http://schemas.datacontract.org/2004/07/System.Data"> 
<a:EntityContainerName>busExpressEntities</a:EntityContainerName>
<a:EntityKeyValues>
  <a:EntityKeyMember>
    <a:Key>routeId</a:Key>
    <a:Value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">1231</a:Value>
  </a:EntityKeyMember>
</a:EntityKeyValues>
<a:EntitySetName>RouteSet</a:EntitySetName>
</EntityKey>
<POI />
<POILines />
<dateEffectiveFrom i:nil="true" />
<dateEffectiveTo i:nil="true" />
<isLive>true</isLive>
<relativePosition>0</relativePosition>
<routeDescription />
<routeId>1231</routeId>
<routeMap />
<routeName>1 Whitehawk - Mile Oak</routeName>
<route_stop>
<route_stop z:Id="i3">
<EntityKey z:Id="i4" xmlns="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses" xmlns:a="http://schemas.datacontract.org/2004/07/System.Data">
    <a:EntityContainerName>busExpressEntities</a:EntityContainerName>
    <a:EntityKeyValues>
      <a:EntityKeyMember>
        <a:Key>routeId</a:Key>
        <a:Value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">1231</a:Value>
      </a:EntityKeyMember>
      <a:EntityKeyMember>
        <a:Key>stopId</a:Key>
        <a:Value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">6882</a:Value>
      </a:EntityKeyMember>
    </a:EntityKeyValues>
    <a:EntitySetName>route_stop</a:EntitySetName>
  </EntityKey>
  <alightingTariffCode>1</alightingTariffCode>
  <boardingTariffCode>1</boardingTariffCode>
  <route z:Ref="i1" />
  <routeId>1231</routeId>
  <routeIndex>1</routeIndex>
  <routeReference xmlns:a="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses">
    <a:EntityKey z:Ref="i2" xmlns:b="http://schemas.datacontract.org/2004/07/System.Data" />
  </routeReference>
  <stop z:Id="i5">
    <EntityKey z:Id="i6" xmlns="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses" xmlns:a="http://schemas.datacontract.org/2004/07/System.Data">
      <a:EntityContainerName>busExpressEntities</a:EntityContainerName>
      <a:EntityKeyValues>
        <a:EntityKeyMember>
          <a:Key>stopId</a:Key>
          <a:Value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">6882</a:Value>
        </a:EntityKeyMember>
      </a:EntityKeyValues>
      <a:EntitySetName>StopSet</a:EntitySetName>
    </EntityKey>
    <AtcoCode>149000006612</AtcoCode>
    <GPSStopName>Swanborough Dr.</GPSStopName>
    <Lat>50.8326729229821</Lat>
    <Long>-0.103217996656901</Long>
    <LongName>Swanborough Drive</LongName>
    <NaptanCode>bridmpj</NaptanCode>
    <OperatorsCode1>06612</OperatorsCode1>
    <OperatorsCode2>6612</OperatorsCode2>
    <OperatorsCode3>51581</OperatorsCode3>
    <OperatorsCode4>bridmpj</OperatorsCode4>
    <StopName>Swanborough Drive</StopName>
    <route_stop>
      <route_stop z:Ref="i3" />
    </route_stop>
    <route_stop_stop />
    <route_stop_timetable_stop />
    <stopId>6882</stopId>
  </stop>
  <stopId>6882</stopId>
  <stopReference xmlns:a="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses">
    <a:EntityKey z:Ref="i6" xmlns:b="http://schemas.datacontract.org/2004/07/System.Data" />
  </stopReference>
</route_stop>
<route_stop z:Id="i7">
  <EntityKey z:Id="i8" xmlns="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses" xmlns:a="http://schemas.datacontract.org/2004/07/System.Data">
    <a:EntityContainerName>busExpressEntities</a:EntityContainerName>
    <a:EntityKeyValues>
      <a:EntityKeyMember>
        <a:Key>routeId</a:Key>
        <a:Value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">1231</a:Value>
      </a:EntityKeyMember>
      <a:EntityKeyMember>
        <a:Key>stopId</a:Key>
        <a:Value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">6883</a:Value>
      </a:EntityKeyMember>
    </a:EntityKeyValues>
    <a:EntitySetName>route_stop</a:EntitySetName>
  </EntityKey>
  <alightingTariffCode>1</alightingTariffCode>
  <boardingTariffCode>1</boardingTariffCode>
  <route z:Ref="i1" />
  <routeId>1231</routeId>
  <routeIndex>2</routeIndex>
  <routeReference xmlns:a="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses">
    <a:EntityKey z:Ref="i2" xmlns:b="http://schemas.datacontract.org/2004/07/System.Data" />
  </routeReference>
  <stop z:Id="i9">
    <EntityKey z:Id="i10" xmlns="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses" xmlns:a="http://schemas.datacontract.org/2004/07/System.Data">
      <a:EntityContainerName>busExpressEntities</a:EntityContainerName>
      <a:EntityKeyValues>
        <a:EntityKeyMember>
          <a:Key>stopId</a:Key>
          <a:Value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">6883</a:Value>
        </a:EntityKeyMember>
      </a:EntityKeyValues>
      <a:EntitySetName>StopSet</a:EntitySetName>
    </EntityKey>
    <AtcoCode>149000006613</AtcoCode>
    <GPSStopName>Haybourne Road</GPSStopName>
    <Lat>50.8317788816436</Lat>
    <Long>-0.10486427645364671</Long>
    <LongName>Haybourne Road</LongName>
    <NaptanCode>brimapm</NaptanCode>
    <OperatorsCode1>06613</OperatorsCode1>
    <OperatorsCode2>6613</OperatorsCode2>
    <OperatorsCode3>51701</OperatorsCode3>
    <OperatorsCode4>brimapm</OperatorsCode4>
    <StopName>Haybourne Road</StopName>
    <route_stop>
      <route_stop z:Ref="i7" />
    </route_stop>
    <route_stop_stop />
    <route_stop_timetable_stop />
    <stopId>6883</stopId>
  </stop>
  <stopId>6883</stopId>
  <stopReference xmlns:a="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses">
    <a:EntityKey z:Ref="i10" xmlns:b="http://schemas.datacontract.org/2004/07/System.Data" />
  </stopReference>
</route_stop>
</Route>

I have the following code to get the URL –

 WebClient client = new WebClient(); 
    client.OpenReadCompleted += new OpenReadCompletedEventHandler(client_OpenReadCompleted);
    Uri url = new Uri("http://www.buscms.com/brightonbuses/v1/route.aspx?routeid=1231&stops=true&maps=true", UriKind.Absolute); 
    client.OpenReadAsync(url); 

What’s the next stop in this part

public void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
    {

    } 

So that I am able to get the stops in the xml that is in the url?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:43:34+00:00Added an answer on June 4, 2026 at 8:43 am

    For a start, I wouldn’t use the OpenRead method, I would go with DownloadString instead, so your initial call would be:

            void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            WebClient client = new WebClient();
            client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
            Uri url = new Uri("http://www.buscms.com/brightonbuses/v1/route.aspx?routeid=1231&stops=true&maps=true", UriKind.Absolute);
            client.DownloadStringAsync(url);
        }
    

    And your event handler would then look like this

    void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result != null)
                {
                    XDocument doc = XDocument.Parse(e.Result);
                    XNamespace ns = "http://schemas.datacontract.org/2004/07/BusExpress.ClassLibrary";
                    var routeNames = (from n in doc.Descendants(ns + "Route")
                                     select new
                                     {
                                         RouteName = n.Element(ns + "routeName").Value,
                                         Stops = (from s in n.Element(ns + "route_stop").Elements(ns + "route_stop")
                                                  select new
                                                  {
                                                      StopCode = s.Element(ns + "stop").Element(ns + "OperatorsCode4").Value,
                                                      StopName = s.Element(ns + "stop").Element(ns + "StopName").Value
                                                      StopId = s.Element(ns + "stop").Element(ns + "stopId").Value
    
                                                  }).ToList()
                                     }).Single();
    
    
                    listBusStops.ItemsSource = routeNames.Stops;
    
                    // Do something with the list of Route Names in routeNames
                }
            }
        }
    

    Note the use of the XNamespace in order to find the routeName tags.

    Don’t forget to add a reference to System.Xml.Linq to your project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got this data I get from an XML feed and parse as NSDictionaries.
I have setup a SenchaTouch/PhoneGap app that pulls information from an external XML feed.
I have this script to generate an XML file for an RSS feed. Works
I have a json feed from this URL which contains 20 fields and I
i have this: Dim split As String() = temp_string.Split(,) ''#feed all info into global
I use this bit of code to feed some data i have parsed from
I have a model, Feed, that has and belongs to many FilteredUsers. In this
I'm trying to get an xml feed from a website, nothing really special. My
I have a problem with an app that takes an XML feed, parses it,
I have activity that parses XML feed (with news) and loads parsed data (text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.