Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extract the DepartureTerminal from this XML

Status
Not open for further replies.

crmpicco

Programmer
Nov 29, 2004
66
GB
how do i extract the DepartureTerminal from this XML?

Cheers.

Picco

<code>
<PoweredAir_MultiAvailabilityReply>
- <DepartureRecommendedSegment>
- <RecommendedSegment>
- <FlightInfo>
<DepartureDate>19 July</DepartureDate>
<DepartureTime>17:15</DepartureTime>
<ArrivalDate>19 July</ArrivalDate>
<ArrivalTime>18:35</ArrivalTime>
<DepartureAirport>GLA</DepartureAirport>
<DepartureAirportName>Glasgow Int'l</DepartureAirportName>
<DepartureCityName>Glasgow</DepartureCityName>
<ArrivalAirport>LHR</ArrivalAirport>
<ArrivalAirportName>Heathrow</ArrivalAirportName>
<ArrivalCityName>London</ArrivalCityName>
<Airline>BD</Airline>
<AirlineName>BMI British Midland</AirlineName>
<FlightNumber>11</FlightNumber>
<Class>YOSBKMHQVGWEX</Class>
<ClassName>Economy</ClassName>
<AircraftType>320</AircraftType>
<AircraftName>Airbus A320-100/200 2 Jet engines</AircraftName>
<NoOfStops>0</NoOfStops>
<DepartureTerminal>M</DepartureTerminal>
<ArrivalTerminal>1</ArrivalTerminal>
<CodeSharing />
<CodeSharingName />
- <LevelOfAccess>
<Type>1A</Type>
<Type>LSA</Type>
<Type>M</Type>
</LevelOfAccess>
<DepartureAPIDate>190705</DepartureAPIDate>
<ArrivalAPIDate>190705</ArrivalAPIDate>
</FlightInfo>
</code>
 
It's not possible right now, because it's invalid XML -- you're missing the closing tags for:
[tab]RecommendedSegment
[tab]DepartureRecommendedSegment
[tab]PoweredAir_MultiAvailabilityReply

But once you correct that, I think an XPath that will work for you is:
[tab]code/FlightInfo/DepartureTerminal

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
or just...
"//DepartureTerminal"

If you are using DOM, it's...
DomDocument.SelectSingleNode("//DepartureTerminal")

If you are using XSL, it's...
<xsl:value-of select="//DepartureTerminal"/>

-Josh


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top