On Thu, 20 Nov 2003, Scott Fletcher wrote: > > Anyway, don't do that, use an existing XML parser.. > > I'll try. I haven't got the PHP XML Parser to work, I think it is > because the XML stuffs I receive is not a true XML, some of them don't > have a closing tag either because one tag have actual data as an > attribute inside one tag. It is kind of frustrating to on not knowing > what XML Parser will work.
I was only suggesting that rather than try to perfect your own parser, you'd be better off spending that time getting comfortable with something that already exists for this purpose. There is too much debugging, testing, optimization and research required to build one that is adequate, and many already exist that probably exceed any home-brew solution. I have not done too much XML parsing in PHP yet, but you might look to PEAR for help with this. I've briefly experimented with the various PEAR XML packages, like XML_Tree and XML_Parser. Take a look: http://pear.php.net/packages.php?catpid=22&catname=XML If you're dealing with poorly formed XML then you've got another problem if you're trying to actually parse it. To simply pull one or two values out of the file, a regex still might be the quickest/dirtiest.. If you do want to move forward testing parsers and stuff, make yourself a valid XML file to test with, so that is not the issue...worry about fixing malformed XML later with the provider or through an intermediate filter.. -- Kelly Hallman //Ultrafancy/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php