$responsexml = @simplexml_load_string($result, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
foreach ($responsexml as $hotelresponse)
{
$hotelname = ($hotelresponse->HotelInfo->Name);
$hoteldestination = ($hotelresponse->HotelInfo->Destination->Name);
$hotelcategory = ($hotelresponse->HotelInfo->Category);
$hotelimage = ($hotelresponse->HotelInfo->ImageList->Image[0]->Url);
$returnedoutput .= $modx->getChunk('_testxmlchunk',array(
'hotel' => $hotelname,
'destination' => $hoteldestination,
'category' => $hotelcategory,
'image' => $hotelimage,
));
}
return $returnedoutput;
$responsexml = @simplexml_load_string($result, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
foreach ($responsexml as $hotelresponse)
{
$hotelname = ($hotelresponse->HotelInfo->Name);
$hoteldestination = ($hotelresponse->HotelInfo->Destination->Name);
$hotelcategory = ($hotelresponse->HotelInfo->Category);
$hotelimage = ($hotelresponse->HotelInfo->ImageList->Image[0]->Url);
$returnedoutput .= $hotelname.' '.$hotelimage.' '. $hoteldestination.' '.$hotelcategory.';
}
return $returnedoutput;
This question has been answered by gee. See the first response.
$responsexml = @simplexml_load_string($result, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
foreach ($responsexml as $hotelresponse)
{
$hotelname = ($hotelresponse->HotelInfo->Name);
$hoteldestination = ($hotelresponse->HotelInfo->Destination->Name);
$hotelcategory = ($hotelresponse->HotelInfo->Category);
$hotelimage = ($hotelresponse->HotelInfo->ImageList->Image[0]->Url);
//////add this/////SET THE PLACEHOLDER START/////////////
$modx->setPlaceholder('hotel',$hotelname);
$modx->setPlaceholder('destination',$hoteldestination);
$modx->setPlaceholder('category',$hotelcategory);
$modx->setPlaceholder('image',$hotelimage);
/////add this////SET THE PLACEHOLDER END//////////////
$returnedoutput .= $modx->getChunk('_testxmlchunk',array(
'hotel' => $hotelname,
'destination' => $hoteldestination,
'category' => $hotelcategory,
'image' => $hotelimage,
));
}
return $returnedoutput;