<HotelValuedAvailRS xmlns="http://ift.tt/1erYOQp" xmlns:xsi="http://ift.tt/ra1lAU" xsi:schemaLocation="http://ift.tt/1erYOQp HotelValuedAvailRS.xsd" timeToExpiration="1799971" totalItems="90" echoToken="DummyEchoToken"><AuditData><ProcessTime>275</ProcessTime><Timestamp>2014-11-04 11:39:28.253</Timestamp><SchemaRelease>2005/06</SchemaRelease><HydraCoreRelease>2014.07.10.PCI</HydraCoreRelease><HydraEnumerationsRelease>N/A</HydraEnumerationsRelease><MerlinRelease>N/A</MerlinRelease></AuditData><PaginationData currentPage="1" totalPages="5"/><ServiceHotel xsi:type="ServiceHotel" availToken="18S4Jo2aVQeZLWqDTnJ3bwbh"><ContractList><Contract><Name>ID_B2B_24#BARI</Name><IncomingOffice code="1"></IncomingOffice><Classification code="NOR">Online Price</Classification></Contract></ContractList><DateFrom date="20141228"/><DateTo date="20141230"/><Currency code="EUR">Euro</Currency><HotelInfo xsi:type="ProductHotel"><Code>271</Code><Name>TRYP Palma Bellver Hotel</Name><ImageList><Image><Type>jpg</Type><Order>1</Order><VisualizationOrder>1</VisualizationOrder><Url>jpg</Url></Image><Image><Type>jpg</Type><Order>2</Order><VisualizationOrder>2</VisualizationOrder><Url>jpg</Url></Image></ImageList></HotelInfo><HotelInfo xsi:type="ProductHotel"><Code>272</Code><Name>Beach Hotel</Name><ImageList><Image><Type>jpg</Type><Order>3</Order><VisualizationOrder>3</VisualizationOrder><Url>jpg</Url></Image><Image><Type>jpg</Type><Order>4</Order><VisualizationOrder>4</VisualizationOrder><Url>jpg</Url></Image></ImageList></HotelInfo></ServiceHotel></HotelValuedAvailRS>
C# Code
XmlDocument xdcDocument = new XmlDocument();
xdcDocument.Load(@"E:\\Hotel.xml");
var nsmgr = new XmlNamespaceManager(xdcDocument.NameTable);
nsmgr.AddNamespace("ns", "http://ift.tt/1erYOQp");
var nl = xdcDocument.SelectNodes("/ns:HotelValuedAvailRS/ns:ServiceHotel/ns:HotelInfo", nsmgr);
foreach (XmlNode xndNode in nl)
{
string name = xndNode["Name"].InnerText;
var nl3 = xdcDocument.SelectNodes("/ns:HotelValuedAvailRS/ns:ServiceHotel/ns:HotelInfo/ns:ImageList/ns:Image", nsmgr);
foreach (XmlNode xndNode3 in nl3)
{
string url = xndNode3["Url"].InnerText;
string order = xndNode3["Order"].InnerText;
}
}
I want to read every details comes under Images list in every hotel info. But my second foreach looping all the images list details without move to next hotel info with first foreach loop.
No comments:
Post a Comment