[eluser]Unknown[/eluser]
Hello, I think all are fine.
In learning framework i am facing many problem, from which maximum problem i can solve myself.
But now a problem giving me very botheration.
To read a xml file, my code which i have kept in controller
Code:
class Xml extends CI_Controller {
function index()
{
//load the parser library
$this->load->library('parser');
$data['title'] = 'Parsing XML using Simplexml class of CodeIgniter';
$data['products'] = $this->_getXML('new');
$this->parser->parse('xml_view', $data);
}
function _getXML($fname)
{
$filename = $fname.'.xml';
$xmlfile="http://www.acerdriversupdateutility.com/acer-travelmate-4060-drivers-utility.xml";
$xmlRaw = file_get_contents($xmlfile);
$this->load->library('simplexml');
$xmlData = $this->simplexml->xml_parse($xmlRaw);
foreach($xmlData['item'] as $row)
{
$result .= '<tr>';
$result .= '<td>'.$row['XML_DIZ_INFO'].'</td>';
$result .= '<td>'.$row['RoboSoft'].'</td>';
$result .= '<td>'.$row['category'].'</td>';
$result .= '<td>$ '.$row['price'].'</td>';
$result .= '</tr>';
}
return $result;
}
}
by running the page showing error
An Error Was Encountered
Unable to load the requested class: simplexml
what can i do here?