Γεια σας παιδια,
επειδή ΔΕΝ το εχω (και) με την αναγνωση XML αρχείου.
Θέλω να διαβασω το RoomType απο το αρχείο καθώς και τις υπολοιπες πληροφορίες.
Τι πρέπει να γραψω;
Μεχρι στιγμής είμαι εδω:
XmlDocument doc = new XmlDocument();
doc.Load("responce.xml");
XmlNodeList infos = doc.GetElementsByTagName("HotelReservationInfo"); //η loop μας!!!
foreach (XmlElement infElem in infos)
{
}
<?xml version="1.0" encoding="UTF-8"?>
<AgentReservationListRS Target="Production" Version="1.000" TimeStamp="2014-12-13T19:58:16+02:00" EchoToken="chris" xmlns="
http://www.opentravel.org/OTA/2003/05">
<BuyerReservations>
<BuyerInfo BusinessID="AHDaaaweb" Name="AAA Web Travel LTD. - Irini Velonaki" ContractType="B2B_TYPE" Address="46, Amalias Ave." City="Athens" PostCode="105 58" Country="GR" Phone="210-9483580" Category="Other" />
<HotelReservations>
<HotelReservationInfo>
<HotelReservation RoomStayReservation="true">
<RoomStays>
<RoomStay IndexNumber="1">
<RoomTypes>
<RoomType RoomTypeCode="00002" NumberOfUnits="1">
<RoomDescription>
<Text>Double Room</Text>
<Text />
<Text />
</RoomDescription>
<Amenities>
<Amenity RoomAmenity="3" />
<Amenity RoomAmenity="2" />
</Amenities>
</RoomType>
</RoomTypes>
<RatePlans>
<RatePlan RatePlanType="13.RPT" RatePlanCode="00007" RatePlanName="Greek">
<RatePlanDescription>
<Text />
<Text />
</RatePlanDescription>
</RatePlan>
</RatePlans>
<RoomRates>
<RoomRate RatePlanCode="00007" RoomTypeCode="00002" NumberOfUnits="1">
<Rates>
<Rate EffectiveDate="2014-09-27+02:00" ExpireDate="2014-09-28+02:00">
<Base AmountBeforeTax="61.22" />
<AdditionalGuestAmounts>
<AdditionalGuestAmount AgeQualifyingCode="10">
<Amount AmountBeforeTax="0.0" />
</AdditionalGuestAmount>
</AdditionalGuestAmounts>
<Fees>
<Fee Type="Inclusive" Code="14.MPT" Amount="0.0" />
</Fees>
<Total AmountBeforeTax="61.22" AmountAfterTax="61.22" CurrencyCode="EUR" />
</Rate>
</Rates>
<Total AmountAfterTax="61.22" />
</RoomRate>
</RoomRates>
<GuestCounts>
<GuestCount Count="2" AgeQualifyingCode="10" />
</GuestCounts>
<TimeSpan Start="2014-09-27" End="2014-09-28+02:00" />
<DepositPayments>
<GuaranteePayment PaymentCode="8">
<AcceptedPayments>
<AcceptedPayment>
<PaymentCard CardType="1" CardCode="VI" />
</AcceptedPayment>
<AcceptedPayment>
<PaymentCard CardType="1" CardCode="MC" />
</AcceptedPayment>
</AcceptedPayments>
<AmountPercent CurrencyCode="EUR" Amount="61.22" />
<Deadline AbsoluteDeadline="2014-09-27T12:00:00" />
<Description>
<Text>The total amount of your stay must be charged at the time pf the booking</Text>
</Description>
</GuaranteePayment>
</DepositPayments>
<CancelPenalties>
<CancelPenalty>
<Deadline AbsoluteDeadline="2014-09-17T12:00:00.000+03:00" />
<AmountPercent TaxInclusive="true" CurrencyCode="EUR" Amount="0.0" Percent="0.0" />
<PenaltyDescription>
<Text>Please see below cancellation policy</Text>
</PenaltyDescription>
</CancelPenalty>
<CancelPenalty>
<Deadline AbsoluteDeadline="2014-09-27T12:00:00.000+03:00" />
<AmountPercent TaxInclusive="true" CurrencyCode="EUR" Amount="30.61" Percent="50.0" />
<PenaltyDescription>
<Text>Please see below cancellation policy</Text>
</PenaltyDescription>
</CancelPenalty>
<CancelPenalty NonRefundable="true">
<AmountPercent TaxInclusive="true" CurrencyCode="EUR" Amount="61.22" Percent="100.0" />
</CancelPenalty>
</CancelPenalties>
<Total AmountAfterTax="61.22" CurrencyCode="EUR" />
<BasicPropertyInfo HotelCode="AHDAAA00029" HotelName="TITANIA HOTEL">
<Address>
<AddressLine>Panepistimiou 52 </AddressLine>
<CityName>Athens Center</CityName>
<PostalCode>106 78</PostalCode>
<County>Athens</County>
<CountryName Code="GR">Greece</CountryName>
</Address>
<ContactNumbers>
<ContactNumber PhoneNumber="0030-2103326000 " PhoneTechType="1" />
<ContactNumber PhoneNumber="0030-2103300700 " PhoneTechType="3" />
</ContactNumbers>
<Award Provider="PMS" Rating="4" />
</BasicPropertyInfo>
<TPA_Extensions>
<RoomGuests>
<RoomGuest title="" firstName="N/A" lastName="N/A" ageQualifyingCode="10" roomNumber="1" />
<RoomGuest title="" firstName="N/A" lastName="N/A" ageQualifyingCode="10" roomNumber="1" />
</RoomGuests>
<RoomStayStatus>ACTIVE</RoomStayStatus>
<SellerCommission>1.22</SellerCommission>
<BuyerCommission>0.0</BuyerCommission>
</TPA_Extensions>
<ResGuestRPHs>
<ResGuestRPH RPH="1" />
</ResGuestRPHs>
</RoomStay>
</RoomStays>
<ResGuests>
<ResGuest AgeQualifyingCode="10" ResGuestRPH="1">
<Profiles>
<ProfileInfo>
<Profile ProfileType="1">
<Customer>
<PersonName>
<GivenName>George</GivenName>
<Surname>Bountounis</Surname>
</PersonName>
<Email>
[email protected]</Email>
</Customer>
<Affiliations>
<TravelArranger Code="AHDaaaweb" />
</Affiliations>
</Profile>
</ProfileInfo>
</Profiles>
</ResGuest>
</ResGuests>
<ResGlobalInfo>
<TimeSpan Start="2014-09-27+03:00" End="2014-09-28+03:00" />
<Total AmountAfterTax="61.22" CurrencyCode="EUR" />
<HotelReservationIDs>
<HotelReservationID ResID_Type="14" ResID_Value="CONFAHD20140728172510240" ResID_Source="ENTRADA" ResID_SourceContext="Ahead Travel Test" ForGuest="true" ResID_Date="2014-07-28T17:25:10.240+03:00" />
</HotelReservationIDs>
<Profiles>
<ProfileInfo>
<Profile>
<CompanyInfo>
<CompanyName>Santorini Travel</CompanyName>
<AddressInfo>
<AddressLine>ATHENS</AddressLine>
<CountryName Code="GR">Greece</CountryName>
</AddressInfo>
<TelephoneInfo PhoneNumber="2109933456, 697245678" />
<Email>
[email protected]</Email>
</CompanyInfo>
</Profile>
</ProfileInfo>
</Profiles>
</ResGlobalInfo>
<TPA_Extensions>
<ReservationBuyingPrice totalCost="60.0" fromCurrency="EUR" toCurrency="EUR" exchangeRate="1" />
<ContractBuyerCreditLimit>483.51</ContractBuyerCreditLimit>
<ReservationStatus>ACTIVE</ReservationStatus>
<BuyerID>AHDaaaweb</BuyerID>
</TPA_Extensions>
</HotelReservation>
<AdditionalInfo BuyerCommission="0.0" SellerCommission="1.22">
<SupplierInfo BusinessID="AHDAAA" Name="Ahead Travel Test" ContractType="B2B_TYPE" Address="46 Amalias Ave" City="Athens" PostCode="10558" Country="GR" Phone="2109483580" />
</AdditionalInfo>
</HotelReservationInfo>