Welcome Guest, Not a member yet? Register   Sign In
simplexml parsing fails if only one item
#5

[eluser]pistolPete[/eluser]
Do you have to use this library? Do you use PHP4 or PHP5?
If you have access to PHP5 you could use the SimpleXML class:

Code:
$this->load->helper('security');

$xmlRaw = file_get_contents($filename);

$xml = new SimpleXMLElement($xmlRaw);
foreach ($xml->ARTICLE as $article)
{
        $id = xss_clean($article['ID']);
        $posting_date = xss_clean($article['POSTING_DATE']);
        ...                
}

I just tried it with one and several ARTICLE entries and it worked.


Messages In This Thread
simplexml parsing fails if only one item - by El Forum - 08-30-2009, 09:57 AM
simplexml parsing fails if only one item - by El Forum - 08-31-2009, 10:32 PM
simplexml parsing fails if only one item - by El Forum - 09-01-2009, 02:32 AM
simplexml parsing fails if only one item - by El Forum - 09-01-2009, 09:32 AM
simplexml parsing fails if only one item - by El Forum - 09-01-2009, 11:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB