none
Can't navigate through the xml tree using descendents RRS feed

  • Question

  • I am trying to get hold of a node inside an xml tree.  I am using the following code:

    XDocument.Parse(xmlTree).Descendants("PackageHolidays ")

    But no matter what I do it always returns null for the xml below.  I am not sure if it has something to do with the xsi - but this xml is coming from an external xml.

    <?xml version="1.0" encoding="UTF-8"?>
    <FAB_PkgAvailRS xmlns="http://www.xmltravel.com/fab/2002/09" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Target="test" Version="2002A" xsi:type="FAB_PkgAvailRS">
    	<SyndicatorInfo SyndicatorId="asdfasdf"/>
    	<SessionInfo FABSessionId="asdfasdfasdf" CreateNewSession="true"/>
    	<HolidaySearchResponse Success="true" ModifiedRequest="false">
    		<ViewInfo Offset="0" Length="10"/>
    		<ResultSetInfo SortCode="cost" SortAscending="true" MaxItems="100" NumItems="10"/>
    		<PackageHolidays>
    			<PackageHoliday ItineraryId="si1001" Supplier="ZB" Country="ES" NumberOfNights="7" LeadInPricePerPassenger="120.07" FlightOnly="true" OneWayOnly="false" BookableByFAB="true" Currency="GBP" BookingChannel="WEB" PassengerIdRequired="false" PassengerIdMandatory="false" NationalityRequired="false" NationalityMandatory="false">
    				<Flight OriginAirport="LTN" DestinationAirport="ACE" DepartureDate="20091203" DepartureTime="1440" ReturnHomeDate="20091210" ReturnHomeTime="2350" OutboundFlightClass="economy" ReturnFlightClass="economy" ReturnHomeDepartDate="20091210" ReturnHomeDepartTime="1950" ArrivalDate="20091203" ArrivalTime="1850" OutboundFlightNumber="ZB74" ReturnFlightNumber="ZB75" OutboundFlightBasePrice="52.55" ReturnFlightBasePrice="37.54" OutboundCarrier="ZB" ReturnCarrier="ZB" MarketingCarrier="ZB" OutboundAirlineName="Monarch Airlines" ReturnAirlineName="Monarch Airlines" OriginAirportName="London Luton" DestinationAirportName="Arrecife" FareType="NoFrills" OutboundCabinClass="economy" ReturnCabinClass="economy"/>
    			</PackageHoliday>
    			<PackageHoliday ItineraryId="si1002" Supplier="ZB" Country="ES" NumberOfNights="7" LeadInPricePerPassenger="120.07" FlightOnly="true" OneWayOnly="false" BookableByFAB="true" Currency="GBP" BookingChannel="WEB" PassengerIdRequired="false" PassengerIdMandatory="false" NationalityRequired="false" NationalityMandatory="false">
    				<Flight OriginAirport="LTN" DestinationAirport="ACE" DepartureDate="20091205" DepartureTime="0800" ReturnHomeDate="20091212" ReturnHomeTime="1710" OutboundFlightClass="economy" ReturnFlightClass="economy" ReturnHomeDepartDate="20091212" ReturnHomeDepartTime="1310" ArrivalDate="20091205" ArrivalTime="1210" OutboundFlightNumber="ZB74" ReturnFlightNumber="ZB75" OutboundFlightBasePrice="52.55" ReturnFlightBasePrice="37.54" OutboundCarrier="ZB" ReturnCarrier="ZB" MarketingCarrier="ZB" OutboundAirlineName="Monarch Airlines" ReturnAirlineName="Monarch Airlines" OriginAirportName="London Luton" DestinationAirportName="Arrecife" FareType="NoFrills" OutboundCabinClass="economy" ReturnCabinClass="economy"/>
    			</PackageHoliday>
    			<PackageHoliday ItineraryId="183447" Supplier="COS" Country="PT" NumberOfNights="7" LeadInPricePerPassenger="121.0" FlightOnly="true" BookableByFAB="true" Currency="GBP" BookingChannel="XML">
    				<Flight OriginAirport="LTN" DestinationAirport="ACE" DepartureDate="20091203" DepartureTime="1440" ReturnHomeDate="20091210" ReturnHomeTime="2350" OutboundTravelCode="LCG4F" ReturnTravelCode="LCG4F" ReturnHomeDepartDate="20091210" ReturnHomeDepartTime="1950" ArrivalDate="20091203" ArrivalTime="1850" OutboundFlightNumber="ZB74" ReturnFlightNumber="ZB75" OutboundFlightBasePrice="60.5" ReturnFlightBasePrice="60.5" OutboundCarrier="ZB" ReturnCarrier="ZB" OutboundAirlineName="Monarch Airlines" ReturnAirlineName="Monarch Airlines" OriginAirportName="London Luton" DestinationAirportName="Arrecife" OutboundCabinClass="economy" ReturnCabinClass="economy"/>
    			</PackageHoliday>
    			<PackageHoliday ItineraryId="185826" Supplier="COS" Country="PT" NumberOfNights="7" LeadInPricePerPassenger="121.0" FlightOnly="true" BookableByFAB="true" Currency="GBP" BookingChannel="XML">
    				<Flight OriginAirport="LTN" DestinationAirport="ACE" DepartureDate="20091205" DepartureTime="0800" ReturnHomeDate="20091212" ReturnHomeTime="1710" OutboundTravelCode="LCG6F" ReturnTravelCode="LCG6F" ReturnHomeDepartDate="20091212" ReturnHomeDepartTime="1310" ArrivalDate="20091205" ArrivalTime="1210" OutboundFlightNumber="ZB74" ReturnFlightNumber="ZB75" OutboundFlightBasePrice="60.5" ReturnFlightBasePrice="60.5" OutboundCarrier="ZB" ReturnCarrier="ZB" OutboundAirlineName="Monarch Airlines" ReturnAirlineName="Monarch Airlines" OriginAirportName="London Luton" DestinationAirportName="Arrecife" OutboundCabinClass="economy" ReturnCabinClass="economy"/>
    			</PackageHoliday>
    			<PackageHoliday ItineraryId="2318889" Supplier="AVR" Country="ES" NumberOfNights="7" LeadInPricePerPassenger="137.0" FlightOnly="true" BookableByFAB="true" Currency="GBP" BookingChannel="XML">
    				<Flight OriginAirport="LTN" DestinationAirport="ACE" DepartureDate="20091205" DepartureTime="0800" ReturnHomeDate="20091212" ReturnHomeTime="1710" OutboundTravelCode="LCG6F" ReturnTravelCode="LCG6F" ReturnHomeDepartDate="20091212" ReturnHomeDepartTime="1310" ArrivalDate="20091205" ArrivalTime="1210" OutboundFlightNumber="ZB74" ReturnFlightNumber="ZB75" OutboundFlightBasePrice="60.5" ReturnFlightBasePrice="60.5" OutboundCarrier="ZB" ReturnCarrier="ZB" OutboundAirlineName="Monarch Airlines" ReturnAirlineName="Monarch Airlines" OriginAirportName="London Luton" DestinationAirportName="Arrecife" OutboundCabinClass="economy" ReturnCabinClass="economy"/>
    			</PackageHoliday>
    			<PackageHoliday ItineraryId="2317567" Supplier="AVR" Country="ES" NumberOfNights="7" LeadInPricePerPassenger="137.0" FlightOnly="true" BookableByFAB="true" Currency="GBP" BookingChannel="XML">
    				<Flight OriginAirport="LTN" DestinationAirport="ACE" DepartureDate="20091203" DepartureTime="1440" ReturnHomeDate="20091210" ReturnHomeTime="2350" OutboundTravelCode="LCG4F" ReturnTravelCode="LCG4F" ReturnHomeDepartDate="20091210" ReturnHomeDepartTime="1950" ArrivalDate="20091203" ArrivalTime="1850" OutboundFlightNumber="ZB74" ReturnFlightNumber="ZB75" OutboundFlightBasePrice="60.5" ReturnFlightBasePrice="60.5" OutboundCarrier="ZB" ReturnCarrier="ZB" OutboundAirlineName="Monarch Airlines" ReturnAirlineName="Monarch Airlines" OriginAirportName="London Luton" DestinationAirportName="Arrecife" OutboundCabinClass="economy" ReturnCabinClass="economy"/>
    			</PackageHoliday>
    			<PackageHoliday ItineraryId="10141052" Supplier="THO" Country="ES" NumberOfNights="7" LeadInPricePerPassenger="139.0" FlightOnly="true" BookableByFAB="true" Currency="GBP" BookingChannel="VTX">
    				<Flight OriginAirport="LTN" DestinationAirport="ACE" DepartureDate="20091206" DepartureTime="1355" ReturnHomeDate="20091213" ReturnHomeTime="2310" OutboundTravelCode="34263" ReturnTravelCode="34763" ReturnHomeDepartDate="20091213" ReturnHomeDepartTime="1905" ArrivalDate="20091206" ArrivalTime="1805" OutboundFlightNumber="TOM5724" ReturnFlightNumber="TOM5725" OutboundFlightBasePrice="69.5" ReturnFlightBasePrice="69.5" OutboundCarrier="TOM" ReturnCarrier="TOM" OutboundAirlineName="ThomsonFly" ReturnAirlineName="ThomsonFly" OriginAirportName="London Luton" DestinationAirportName="Arrecife" OutboundCabinClass="economy" ReturnCabinClass="economy"/>
    			</PackageHoliday>
    			<PackageHoliday ItineraryId="10124327" Supplier="THO" Country="ES" NumberOfNights="7" LeadInPricePerPassenger="145.0" FlightOnly="true" BookableByFAB="true" Currency="GBP" BookingChannel="VTX">
    				<Flight OriginAirport="LTN" DestinationAirport="ACE" DepartureDate="20091129" DepartureTime="1355" ReturnHomeDate="20091206" ReturnHomeTime="2310" OutboundTravelCode="34263" ReturnTravelCode="34763" ReturnHomeDepartDate="20091206" ReturnHomeDepartTime="1905" ArrivalDate="20091129" ArrivalTime="1805" OutboundFlightNumber="TOM5724" ReturnFlightNumber="TOM5725" OutboundFlightBasePrice="64.5" ReturnFlightBasePrice="64.5" OutboundCarrier="TOM" ReturnCarrier="TOM" OutboundAirlineName="ThomsonFly" ReturnAirlineName="ThomsonFly" OriginAirportName="London Luton" DestinationAirportName="Arrecife" OutboundCabinClass="economy" ReturnCabinClass="economy"/>
    			</PackageHoliday>
    			<PackageHoliday ItineraryId="4831488" Supplier="FIR" Country="ES" NumberOfNights="7" LeadInPricePerPassenger="145.0" FlightOnly="true" BookableByFAB="true" Currency="GBP" BookingChannel="VTX">
    				<Flight OriginAirport="LTN" DestinationAirport="ACE" DepartureDate="20091129" DepartureTime="1355" ReturnHomeDate="20091206" ReturnHomeTime="2310" OutboundTravelCode="34263" ReturnTravelCode="34763" ReturnHomeDepartDate="20091206" ReturnHomeDepartTime="1905" ArrivalDate="20091129" ArrivalTime="1805" OutboundFlightNumber="TOM5724" ReturnFlightNumber="TOM5725" OutboundFlightBasePrice="64.5" ReturnFlightBasePrice="64.5" OutboundCarrier="TOM" ReturnCarrier="TOM" OutboundAirlineName="ThomsonFly" ReturnAirlineName="ThomsonFly" OriginAirportName="London Luton" DestinationAirportName="Arrecife" OutboundCabinClass="economy" ReturnCabinClass="economy"/>
    			</PackageHoliday>
    			<PackageHoliday ItineraryId="4847678" Supplier="FIR" Country="ES" NumberOfNights="7" LeadInPricePerPassenger="155.0" FlightOnly="true" BookableByFAB="true" Currency="GBP" BookingChannel="VTX">
    				<Flight OriginAirport="LTN" DestinationAirport="ACE" DepartureDate="20091206" DepartureTime="1355" ReturnHomeDate="20091213" ReturnHomeTime="2310" OutboundTravelCode="34263" ReturnTravelCode="34763" ReturnHomeDepartDate="20091213" ReturnHomeDepartTime="1905" ArrivalDate="20091206" ArrivalTime="1805" OutboundFlightNumber="TOM5724" ReturnFlightNumber="TOM5725" OutboundFlightBasePrice="69.5" ReturnFlightBasePrice="69.5" OutboundCarrier="TOM" ReturnCarrier="TOM" OutboundAirlineName="ThomsonFly" ReturnAirlineName="ThomsonFly" OriginAirportName="London Luton" DestinationAirportName="Arrecife" OutboundCabinClass="economy" ReturnCabinClass="economy"/>
    			</PackageHoliday>
    		</PackageHolidays>
    	</HolidaySearchResponse>
    </FAB_PkgAvailRS>
    Tuesday, October 6, 2009 4:27 PM

Answers