Im parsing through a returned httpresponse. I'm looking for a value of ("Typeservice") which I'm getting correctly.
Problem is the element type service is apperaing twice.
I only need the typeservice from the Location Origin role.
- <Location Role="Origin">
<City>ELKTON</City>
<StatePostalCode>TN</StatePostalCode>
<ZipCode>38455</ZipCode>
<NationCode>USA</NationCode>
<Terminal>409</Terminal>
<Zone>2</Zone>
<TypeService>Direct</TypeService>
<AirportCode />
</Location>
- <Location Role="Destination">
<City>Someplace</City>
<StatePostalCode>AZ</StatePostalCode>
<ZipCode>12345</ZipCode>
<NationCode>USA</NationCode>
<Terminal>409</Terminal>
<Zone>2</Zone>
<TypeService>Direct</TypeService>
<AirportCode />
</Location>
How would I refernece it. I'm using
If reader.MoveToContent() = XmlNodeType.Element And reader.Name = "TypeService"
to get the element node I want. I'm not sure how to reference the <Location Role="Origin">
Thanks.
Code:
Dim isdirect as string = nothing
While reader.Read
If reader.MoveToContent() = XmlNodeType.Element And reader.Name = "TypeService" Then
isdirect = reader.ReadElementString("TypeService")
End If
End While
Problem is the element type service is apperaing twice.
I only need the typeservice from the Location Origin role.
- <Location Role="Origin">
<City>ELKTON</City>
<StatePostalCode>TN</StatePostalCode>
<ZipCode>38455</ZipCode>
<NationCode>USA</NationCode>
<Terminal>409</Terminal>
<Zone>2</Zone>
<TypeService>Direct</TypeService>
<AirportCode />
</Location>
- <Location Role="Destination">
<City>Someplace</City>
<StatePostalCode>AZ</StatePostalCode>
<ZipCode>12345</ZipCode>
<NationCode>USA</NationCode>
<Terminal>409</Terminal>
<Zone>2</Zone>
<TypeService>Direct</TypeService>
<AirportCode />
</Location>
How would I refernece it. I'm using
If reader.MoveToContent() = XmlNodeType.Element And reader.Name = "TypeService"
to get the element node I want. I'm not sure how to reference the <Location Role="Origin">
Thanks.