Re: easy and simple way to read xml into array

From: Date: Wed, 19 Nov 2003 13:24:33 +0000
Subject: Re: easy and simple way to read xml into array
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-170272@lists.php.net to get a copy of this message
Well, I've, and I also have to say that the XML-support in PHP lacks any usability… I am sorry to say this but the above comments indicates a lack of understanding about xml, xml parsing and PHP. The php xml parser is based on expat. expat was written by james clark a person who worked on some of the XML specs.
2 pages code later I still cannot get it to work, and the manual is pretty thin on this chapter... That's because the manual assumes you have the background on xml, maybe you might want to head off to w3schools etc to get this. Have you looked at the articles on phpbuilder on xml parsing with php?
But what seems to happen is that the character data handler is called to randomly number of times, and if I output the current element every time it gets called I get the following output for the xml above: according to the specs the character data handler may be called more than once for each start element. Wheter you use c, php, java c++ or perl.
-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar.

« previous php.general (#170272) next »