Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/09/2015, 21:03
remy
 
Fecha de Ingreso: noviembre-2002
Mensajes: 147
Antigüedad: 21 años, 4 meses
Puntos: 0
como leer xml en php

Hola amigos:
Necesito una ayuda urgente... Miren tengo un XML que me lo devuelven y trato de leer este nodo y no me sale <FreeTextLongDescription>, esto esta en un xml que leo usando
$array = file_get_contents("roomdetail2.xml");

$dom= new DOMDocument();
$dom->loadXML($array);
$hotel_list=$dom->getElementsByTagName("Hotel");
foreach($hotel_list as $hotel_lst) {
$Descriptions = $hotel_lst->getElementsByTagName("Descriptions");
foreach($Descriptions as $Desc) {
$FreeTextLongDescription = $Desc->getElementsByTagName("LongDescription");
foreach($FreeTextLongDescription as $Long) {
$FreeText = $Long->getElementsByTagName("FreeTextLongDescription") ;
foreach($FreeText as $FreeTextLong) {
echo $FreeTextLong->FreeTextLongDescription;
}
}

}


EL XML ES EL SIGUIENTE

<Hotel /><RefPoints/>
<Descriptions><VoucherRemark xmlns=""/>
<ShortDescription desc="The Hilton Garden Inn New York/West 35th Street hotel in New York City is perfectly located in Midtown Manhattan and is just steps from some of New York's best attractions including the Empire State Building, world-famous Macy's at Herald Square, Times Sq"/>
<FreeTextShortDescription desc="The Hilton Garden Inn New York/West 35th Street hotel in New York City is perfectly located in Midtown Manhattan and is just steps from some of New York's best attractions including the Empire State Building, world-famous Macy's at Herald Square, Times Sq"/>
<LongDescription desc="sdfasdfasdfasd"><FreeTextLongDescription>The Hilton Garden Inn New York/West 35th Street hotel in New York City is perfectly located in Midtown Manhattan and is just steps from some of New York's best attractions including the Empire State Building, world-famous Macy's at Herald Square, Times Square, Broadway theaters and Madison Square Garden. Providing the finest quality and services, the Hilton Garden Inn Midtown Manhattan hotel in New York is perfectly designed for business or leisure guests, and offers an abundance of complimentary amenities ensuring your stay in the Big Apple is affordable, fun and hassle-free.The Hilton Garden Inn New York, NY hotel features 298 brand new guest rooms, including two luxurious suites. Each guest room is equipped with:* Spacious, newly appointed guestrooms with 32-inch LCD flat panel televisions, refrigerator, microwave, coffee maker and large work desks with adjustable lighting and ergonomic chairs * Complimentary high-speed wired and wireless internet access is available in each guestroom, featuring secure remote printing directly to our hotel's business center * Complimentary 24-hour Fitness Center, complimentary 24-hour Business Center, and complimentary wireless Internet access in the lobby * Complimentary morning coffee, tea, and USA Today&amp;#194;&amp;#174;* Onsite hotel restaurant* Pavilion Pantry&amp;#194;&amp;#174; Convenience mart - stocked with snacks, drinks &amp; moreThe Hilton Garden Midtown Manhattan hotel in New York, NY can accommodate your small meeting in big city style: * 391 square foot Empire Boardroom.* Boardroom will accommodate up to 14 people.* Audio Visual services and high-speed internet available in the Boardroom.* Catered food &amp; beverage available.The Hilton Garden Inn West 35th Street hotel in New York is pleased to host your wedding guests or social group:* Wedding guests* Family reunions* Sports groups* Anniversaries* Religious celebrations and retreats* High school and college reunionsThe Hilton Garden Inn Manhattan, New York hotel has easy access to the city's best attractions and points of interest: * Empire State Building - 2 blocks* Macy's Herald Square - 2 blocks* Madison Square Garden - 2 blocks* Broadway &amp; Times Square - 7 blocks* Jacob Javits Convention Center - 10 blocks* Penn Station - 2 blocks* Grand Central Terminal - 8 blocks* Port Authority Bus Terminal - 7 blocksThe Hilton Garden Inn New York hotel on West 35th Street is within close proximity to many local businesses and corporations:* Met Life - 2 blocks* Cisco - 2 blocks* Buck Consultants - 2 blocks* United Healthcare - 2 blocks* BMG Columbia House - 2 blocks * Citigroup - 2 blocks* PB Americas - 2 blocks* URS Corporation - 2 blocks* Wachovia - 2 blocks* McGraw Hill - 2 blocks* EMC Corporation - 2 blocks* Compaq Computer - 2 blocks* American Foundation for Blind - 2 blocks* Rainbow Media - 2 blocks* Macy's Department Store - 2 blocks* Federated Department Stores - 2 blocks* Accenture - 5 blocks* Bank of America - 5 blocks* Ernst &amp; Young - 5 blocks* Fashion Institute of Technology - 5 blocks* Verizon - 5 blocksExperience the Hilton Garden Inn New York/West 35th Street hotel in NYC! ***** Everything. Right where you need it. &amp;#194;&amp;#174;*****</FreeTextLongDescription></LongDescription></Descriptions>
</Hotel>

Ojala me puedan ayudar...
He buscado, he probado muchas veces diferentes versiones y nada...

Muchas gracias!