我有以下 xml,我试图从中找出 AddreeLine -
<?xml version="1.0" encoding="UTF-8" standalone="no"?><TravelItineraryReadRS xmlns="http://webservices.sabre.com/sabreXML/2003/07" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" TimeStamp="2013-05-09T17:55:46" Version="1.1.1"><Success/><TravelItinerary><ItineraryRef AirExtras="N" InhibitCode="U" PartitionID="AA" PrimeHostID="1S"><Source PseudoCityCode="TEST" ReceivedFrom="Test Tester"/></ItineraryRef><CustomerInfo><PaymentInfo><Payment RPH="001"><Form>ddd343</Form><Form>34rerere</Form></Payment></PaymentInfo><PersonName NameNumber="01.01" NameReference="SCM0978-NA021215" RPH="1"><GivenName>RESERVATION</GivenName><Surname>TEST</Surname><Email>test@test.COM</Email></PersonName><Telephone AreaCityCode="BDL" PhoneNumber="7/732-555-0400" RPH="001"/><Telephone AreaCityCode="BDL" PhoneNumber="201-555-1350-B" RPH="002"/><Telephone AreaCityCode="BDL" PhoneNumber="201-555-9999-F" RPH="003"/><Telephone AreaCityCode="BDL" PhoneNumber="908-555-6400-C" RPH="004"/><Telephone AreaCityCode="BDL" PhoneNumber="732-555-0872-H" RPH="005"/></CustomerInfo><ItineraryInfo><ReservationItems><Item RPH="1"><FlightSegment ArrivalDateTime="07-28T11:00:00" DepartureDateTime="2013-07-28T09:00:00" FlightNumber="0491" NumberInParty="01" ResBookDesigCode="Q" SegmentNumber="0001" Status="YK"><OriginLocation LocationCode="EWR"/><DestinationLocation LocationCode="DTW"/><MarketingAirline Code="CO" FlightNumber="0491"/><UpdatedDepartureTime>07-28T09:00:00</UpdatedDepartureTime><UpdatedArrivalTime>07-28T11:00:00</UpdatedArrivalTime></FlightSegment></Item><Item RPH="2"><FlightSegment ArrivalDateTime="08-05T20:49:00" DepartureDateTime="2013-08-05T18:55:00" FlightNumber="0482" NumberInParty="01" ResBookDesigCode="Q" SegmentNumber="0003" Status="YK"><OriginLocation LocationCode="DTW"/><DestinationLocation LocationCode="EWR"/><MarketingAirline Code="CO" FlightNumber="0482"/><UpdatedDepartureTime>08-05T18:55:00</UpdatedDepartureTime><UpdatedArrivalTime>08-05T20:49:00</UpdatedArrivalTime></FlightSegment></Item><Item RPH="3"><Hotel SegmentNumber="0002" Status="GK" Type="HHT"><SpecialPrefs><Text>CF</Text></SpecialPrefs><RoomType RoomTypeCode="C2Q"/><RoomRate><Base Amount="69.00"/></RoomRate><GuestCounts><GuestCount Count="01"/></GuestCounts><TimeSpan End="08-05" Start="07-28"/><BasicPropertyInfo ChainCode="AA" HotelCityCode="DTW" HotelName="MARIOTT"/><Address><AddressLine>201 WESTFIELD</AddressLine><AddressLine>DETROIT MI 30293</AddressLine></Address><ContactNumbers><ContactNumber PhoneNumber="717-235-3333"/></ContactNumbers></Hotel></Item></ReservationItems><Ticketing RPH="01" TicketTimeLimit="T-"/></ItineraryInfo><SpecialServiceInfo ItemRPH="001" Type="GFX"><Service SSR_Code="OSI"><Airline Code="YY"/><Text>CTCH 732 555 1212</Text></Service></SpecialServiceInfo><RemarkInfo><Remark Code="L" Number="002" Type="Alpha-Coded"><Text>HOME-25 GATEHOUSE LANE</Text></Remark><Remark Number="002" Type="General"><Text>LHOME-25 GATEHOUSE LANE</Text></Remark><Remark Code="L" Number="003" Type="Alpha-Coded"><Text>HOME-HACKENSACK, NJ US 07601</Text></Remark><Remark Number="003" Type="General"><Text>LHOME-HACKENSACK, NJ US 07601</Text></Remark><Remark Code="P" Number="004" Type="Alpha-Coded"><Text>TP-HM-120 MAIN ST</Text></Remark><Remark Number="004" Type="General"><Text>PTP-HM-120 MAIN ST</Text></Remark><Remark Code="P" Number="005" Type="Alpha-Coded"><Text>TP-HM-BELLE MEAD NJ¤08732</Text></Remark><Remark Number="005" Type="General"><Text>PTP-HM-BELLE MEAD NJ¤08732</Text></Remark><Remark Number="006" Type="Client Address"><Text>SATURN RESERVATIONS</Text></Remark><Remark Number="007" Type="Client Address"><Text>401 HACKENSACK AVE</Text></Remark><Remark Number="008" Type="Client Address"><Text>HACKENSACK NJ US 07065</Text></Remark><Remark Number="009" Type="Client Address"><Text>MAILSTOP 5932</Text></Remark><Remark Number="010" Type="Client Address"><Text>MORE EXTRANEOUS GARBAGE</Text></Remark><Remark Code="H" Number="011" Type="Alpha-Coded"><Text>/GAX4378200000000000EXP 11 16</Text></Remark><Remark Number="011" Type="General"><Text>H/GAX4378200000000000EXP 11 16</Text></Remark><Remark Code="B" Number="012" Type="Alpha-Coded"><Text>SNAP-TYR01</Text></Remark><Remark Number="012" Type="General"><Text>B SNAP-TYR01</Text></Remark><Remark Number="013" Type="General"><Text>X/-BB/U10406</Text></Remark><Remark Number="014" Type="General"><Text>X/-DP/A244</Text></Remark><Remark Number="015" Type="General"><Text>X/-CWT-LEVEL-GOLD-Y-E-I</Text></Remark><Remark Number="016" Type="General"><Text>X/-CN/JNB</Text></Remark><Remark Number="017" Type="General"><Text>X/-CF/JQF0000000</Text></Remark><Remark Number="018" Type="General"><Text>X/-FS/L</Text></Remark><Remark Number="019" Type="General"><Text>X/-HS/08APR/SN-O</Text></Remark><Remark Number="020" Type="Invoice"><Text>U3-MORTGAGE INSURANCE</Text></Remark><Remark Number="021" Type="Invoice"><Text>U8-CARD 123456</Text></Remark><Remark Number="022" Type="Invoice"><Text>U4-MI CANADA</Text></Remark><Remark Number="023" Type="Invoice"><Text>U9-SA8010</Text></Remark></RemarkInfo></TravelItinerary><TPA_Extensions><HostCommand>ARS01S093^PN49JX PNR</HostCommand></TPA_Extensions></TravelItineraryReadRS>
我试图从中找出两个 AddressLine 。我做了以下,但它不工作 -
var bt = (from Main in xmlDoc.Descendants("TravelItineraryReadRS")
select new
{
AddressLine = string.Join(",", (from item in Main.Descendants("Hotel").Descendants("Address")
select item.Element("AddressLine").Value).ToArray()),
}
).ToList();