please tell me where is problem. i wrote this xpath query but its not retriveing me any node. i want to select "HotelName" from it:-
my selector code:
Dim xmlPath As String = Server.MapPath("aa.xml")
Dim doc As XmlDocument = New XmlDocument()
doc.Load(xmlPath)
Dim nodeList As XmlNodeList = doc.DocumentElement.SelectNodes("//HotelInfo/HotelName")
For Each child As XmlNode In nodeList
Response.Write("Node Name: " + child.Name)
Response.Write("Node Value:" + child.FirstChild.Value)
Next
my xml is like this:
<?xml version="1.0" encoding="utf-8"?>
<OTA_HotelDescriptiveInfoRS xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelDescriptiveInfoRS.xsd" TimeStamp="2009-12-29T06:41:55-05:00" Version="1.006" PrimaryLangID="it" EchoToken="1" Target="Test">
<Success />
<Warnings>
<Warning Code="999" Type="2"> Your request's version is earlier than our supported version. We tried to process your request in case the versions are compatible. We support version 1.006 for the OTA_HotelDescriptiveInfoRQ call.</Warning>
</Warnings>
<HotelDescriptiveContents HotelCode="112" HotelCodeContext="HCL" HotelName="Hostal Cruz Sol" HotelCityCode="335">
<HotelDescriptiveContent HotelCode="112" HotelCodeContext="HCL" HotelName="Hostal Cruz Sol" HotelCityCode="335" CurrencyCode="EUR">
<HotelInfo>
<HotelName>Hostal Cruz Sol</HotelName>