Welcome Guest, Not a member yet? Register   Sign In
Page Caching Custom XML
#1

[eluser]Unknown[/eluser]
I am attempting to page cache a large custom XML output from data. I pass the data result sets to the View from the Controller. The View contains the XML format, Element tags, etc.,

When I run this without page caching, everything is fine and my Javascript code is able to process the XML. The XML output in the browser looks normal

When I try to use page caching (ie., $this->output->cache(3600); ) in the Controller, my XML output has changed drastically. All XML Element Tags are gone. Anything wrapped as CDATA doesn't show up.

Any thoughts?


Controller Function:

function gps()
{
$this->output->cache(3600);
header('Content-Type: application/xml');
$this->load->model('xml/instrument_finder', 'instrumentfinder', TRUE);
$page["instruments"] = $this->instrumentfinder->get_gps();
$this->load->view('xml/instruments_list', $page);

}


View:

<instruments>
&lt;?php foreach($instruments->result() as $row):


<instrument>
<station_code>&lt;![CDATA[&lt;?=$row->pnum ?&gt;]]></station_code><station_type>&lt;![CDATA[&lt;?=$row->stntype ?&gt;]]></station_type><name>&lt;![CDATA[&lt;?=$row->stnnickname ?&gt;]]></name><station_date>&lt;?=substr($row->stninsdate, 0, -9)?&gt;</station_date><om_region>&lt;![CDATA[&lt;?=$row->region2?&gt;]]></om_region><status>&lt;![CDATA[&lt;?=$row->stnstatus?&gt;]]></status><city>&lt;![CDATA[&lt;?=$row->sitecity?&gt;]]></city><state>&lt;![CDATA[&lt;?=$row->sitestate?&gt;]]></state><elevation>&lt;![CDATA[&lt;?=$row->elev?&gt;]]></elevation><latitude>&lt;![CDATA[&lt;?=$row->lat?&gt;]]></latitude><longitude>&lt;![CDATA[&lt;?=$row->lon?&gt;]]></longitude><install_type>&lt;![CDATA[&lt;?=$row->montype?&gt;]]></install_type><install_date>&lt;?=$row->moninsdate?&gt;</install_date><study>&lt;![CDATA[&lt;?=$row->localegroup?&gt;]]></study><geology>&lt;![CDATA[&lt;?=$row->geolsumm?&gt;]]></geology><comments>&lt;![CDATA[&lt;?=$row->addinfo?&gt;]]></comments><project>&lt;![CDATA[&lt;?=$row->project?&gt;]]></project><comms>&lt;?=$comms?&gt;</comms><netrs>&lt;?=$netrs?&gt;</netrs><dataflow>&lt;?=$dataflow?&gt;</dataflow><archive>&lt;?=$archive?&gt;</archive><photohtml>&lt;?= $photoHtml ?&gt;</photohtml>
</instrument>


&lt;?php endforeach; ?&gt;

</instruments>
#2

[eluser]searain[/eluser]
Hello do you have found the solution?

I have the same problem. The xml tags are gone in firefox but displayed in IE and in the source code, the xml tags is there.




Theme © iAndrew 2016 - Forum software by © MyBB