XML Get Value of Node DOMXPath

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

Need help to get the value of the node.

We know how to get the value of the city , item and itemPrice nodes below.

How do we get the value of NumberOfRooms?


$hotelElements = $xpath->query( 'xxxx', $searchReponseElement );
						
foreach( $hotelElements as $hotelElement ) 
{

$city = $xpath->query( 'City' , $hotelElement );
$item = $xpath->query( 'Item' , $hotelElement );
$itemPrice = $xpath->query( 'ItemPrice' , $hotelElement );
$confirmation = $xpath->query( 'Confirmation' , $hotelElement );

}
Here is an example of the XML Response:

<Hotel HasExtraInfo="true">
		      <City Code="AMS"><![CDATA[ Amsterdam ]]></City>
		      <Item Code="JAN"><![CDATA[ JAN LUYKEN HTL AND RESIDENCE]]></Item>
		      <LocationDetails>
		          <Location Code="G1"><![CDATA[ Central ]]></Location>
		      </LocationDetails>
		      <StarRating>4</StarRating>
             <HotelRooms>
                 <HotelRoom 
                       Code="SB" 
                       NumberOfRooms="1" />    
                 <HotelRoom 
                       Code="TB" 
                       ExtraBed="true" 
                       NumberCots="1" 
                       NumberOfExtraBeds="2"       
                       NumberOfRooms="1                     
                       SharingBedding="true" />                                     
            </HotelRooms>

Thanks
-- 
View this message in context: http://www.nabble.com/XML-Get-Value-of-Node-DOMXPath-tp21015877p21015877.html
Sent from the PHP - General mailing list archive at Nabble.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux