display parsed xml within wordpress page

I have the following scriot which works great on a .php page.  However, I need it to work within a wordpress page but nothing displays in the page .  I do have the plugin PHP Execution installed and can run a siimple php script in the (html tab) page and I can see the results in my browser.  For some reason though, the following script display nothing.

Any ideas?

I do have simple pie plugin installed but have no idea how and if it can parse out xml and display it in a wp page.
<?php
error_reporting(E_ALL);

$xml = <<<XML
<?xml version="1.0" encoding="UTF-8" ?>
<ls:lookSmartResults xmlns:ls="urn:domainResults">

      <ls:ssResultSet ls:firstResult="1" ls:numResults="2" ls:totalHits="2">
            <ls:ssResult ls:id="1">
                  <ls:abstract><![CDATA[Get it at listproperty.com.au]]></ls:abstract>
                  <ls:title><![CDATA[Car Insurance1]]></ls:title>
                  <ls:url><![CDATA[really long url with name/pair values]]></ls:url>
                  <ls:displayUrl><![CDATA[http://www.domain1.com]]></ls:displayUrl>
                  <ls:cpc>0.0680</ls:cpc>
            </ls:ssResult>
            <ls:ssResult ls:id="2">
                  <ls:abstract><![CDATA[Get it at propertys.com.au]]></ls:abstract>
                  <ls:title><![CDATA[Car Insurance2]]></ls:title>
                  <ls:url><![CDATA[really long url with name/pair values]]></ls:url>
                  <ls:displayUrl><![CDATA[http://www.domain2.com]]></ls:displayUrl>
                  <ls:cpc>0.0442</ls:cpc>
            </ls:ssResult>
      </ls:ssResultSet>

</ls:lookSmartResults>
XML;

// MUNG THE XML TO MAKE IT WORK WELL WITH SIMPLEXML
$new = str_replace('ls:', 'ls_', $xml);

// MAKE AN OBJECT
$obj = SimpleXML_Load_String($new, 'SimpleXMLElement', LIBXML_NOCDATA);

// ACTIVATE THIS TO VISUALIZE THE OBJECT
// var_dump($obj);

// ITERATE OVER THE OBJECT TO EXTRACT AND VISUALIZE ITS CONTENTS
foreach ($obj->ls_ssResultSet->ls_ssResult as $r)
{
    $i = $r["ls_id"];
    $a = (string)$r->ls_abstract;
    $t = (string)$r->ls_title;
    $c = (string)$r->ls_cpc;
	$d = (string)$r->ls_displayUrl;
	$u = (string)$r->ls_url;
    //echo "<br />$i $a $t $c" . PHP_EOL;
	echo "$t<br /><a href=\"$u\" target=\"_blank\">$d</a><br /><br />" . PHP_EOL;
}
?>

Open in new window

COwebmasterAsked:
Who is Participating?
 
jrm213jrm213Commented:
If you view source is the source completely empty? If so that indicates a php error and with error_reporting set like that the error should be displaying if there is one.

Can you check your sites error_log, I would guess the code is causing a problem somewhere else in wordpress either with the plugin or possibly something in your php is causing a problem with the plugin.
0
 
Jason C. LevineNo oneCommented:
Is the XML data local?  WordPress has all kinds of little security tweaks that can block things from being accessed unless you do it just right...
0
 
COwebmasterAuthor Commented:
it's just pulling in links from another site.  it can pull up just fine in a php page but not in a wp page.  It just turns up blank.  I'll check the logs
0
 
COwebmasterAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.