如何在c#中对xml数据进行排序,以根据元素的值获取特定数据

时间:2015-11-16 06:27:20

标签: c# xml model-view-controller

这是我的xml ,,

    <CruiseProduct>
    <ID>4091</ID>
    <Name>MS ROYAL RUBY NILE CRUISE</Name>
    <Description>
       <p><br>In house music panel.<br>Safe deposit box.<br>All modern and high quality installation and amenities.<br><br><br><b>All inclusive formula</b><br>Breakfast open buffet<br>Lunch open buffet<br>dinner open buffet<br>From 11.00 AM till 23.00 HRS<br>Water (Small Bottle)<br>Soft drinks<br>Local beer (Served by glass)<br>Local wine (Only during lunch and dinner)</p><p><br><b><b>The Program includes:</b><br></b>♦ 07 nights’ accommodation on board of MS Royal Ruby or Similar based on Full Board<br>♦ Return airport transfers in Luxor using Shuttle services<br>♦ Guaranteed upgrade to Main / Middle deck cabins.<br>♦ Complimentary Luxor city tour<b><br><br><b>The Program excludes:</b><br></b>♦ Entry visa to Egypt<br>♦ Tips and personal expenses<br>♦ Any other items did not mentioned above</p><p><b><br></b></p><p><b>Attraction - Combo Light Package</b><br>Visit to the east Bank, Karnak and Luxor temples, Visit the Temple shared by two gods Sobek and Haeroris in Kom Ombo afternoon, Morning visit to High dam, Phila   temple<br><b><br>Attraction - Combo Full Package Excursions</b><br>Visit to the East Bank, Karnak and Luxor temples, Visit the Temple shared by two gods Sobek and Haeroris in Kom Ombo afternoon, Visit Edfu Temple, Morning visit to High dam, Philae temple and unfinished obelisk, on return visits West bank, Hatsheput, Valley of the Kings, Memmon colossi Esna Temple<br><br><b>Attraction - Cruise Signature Program</b><br>Visit Dier-al-Madina + Habu Temple + Valley of the Nobles, Dendra Temple by bus + Temple of Hathor-Cript, Edfu OR Kom Ombo Temple (up to the customer) Kalabsha trip + Botanical Gardens + 01 hour felucca </p>
    </Description>
    <Ref>CMBRUB</Ref>
    <Location>Lux</Location>
    <Images>
     <Image>
     <Name>MS Royal Ruby</Name>
     <Description/>
     <URL>
    http://banks.digital-trip.co.uk/assets/images/packages/c228fa2c-18b1-4c93-    9edc-aa3409d07b7b.jpg
    </URL>
    </Image>
<CruiseProduct>
<ID>4091</ID>
<Name>MS ROYAL RUBY NILE CRUISE</Name>
<Description>
   <p><br>In house music panel.<br>Safe deposit box.<br>All modern and high quality installation and amenities.<br><br><br><b>All inclusive formula</b><br>Breakfast open buffet<br>Lunch open buffet<br>dinner open buffet<br>From 11.00 AM till 23.00 HRS<br>Water (Small Bottle)<br>Soft drinks<br>Local beer (Served by glass)<br>Local wine (Only during lunch and dinner)</p><p><br><b><b>The Program includes:</b><br></b>♦ 07 nights’ accommodation on board of MS Royal Ruby or Similar based on Full Board<br>♦ Return airport transfers in Luxor using Shuttle services<br>♦ Guaranteed upgrade to Main / Middle deck cabins.<br>♦ Complimentary Luxor city tour<b><br><br><b>The Program excludes:</b><br></b>♦ Entry visa to Egypt<br>♦ Tips and personal expenses<br>♦ Any other items did not mentioned above</p><p><b><br></b></p><p><b>Attraction - Combo Light Package</b><br>Visit to the east Bank, Karnak and Luxor temples, Visit the  the Kings, Memmon colossi Esna Temple<br><br><b>Attraction - Cruise Signature Program</b><br>Visit Dier-al-Madina + Habu Temple + Valley of the Nobles, Dendra Temple by bus + Temple of Hathor-Cript, Edfu OR Kom Ombo Temple (up to the customer) Kalabsha trip + Botanical Gardens + 01 hour felucca </p>
</Description>
<Ref>CMBRUB</Ref>
<Location>Luxor</Location>
<Images>
 <Image>
 <Name>MS Royal Ruby</Name>
 <Description/>
 <URL>
http://banks.digital-trip.co.uk/assets/images/packages/c228fa2c-18b1-4c93-    9edc-aa3409d07b7b.jpg
</URL>
</Image>

如何通过排序或仅获得位置为“Lux”的数据。 这意味着当一个人从选择菜单中选择“Lux”时,它应该显示只有Locatin“Lux”的所有细节

1 个答案:

答案 0 :(得分:0)

如果您的xml格式正确,您可以这样做。

android:authorities="@string/eml_attachment_provider"