-
XML Parsers
Posted on April 16th, 2005 No commentsI needed an XML parser for PHP 4 and tried MiniXML but ran into many problems with HTML entities. Very strange problems.
I looked into other XML parsers written in PHP but most were too complex for what I needed. So what did I do?Well the obvious thing would be to use SimpleXML right? Well wrong. Because I need something for PHP4 due to the fact that this particular web host won’t upgrade to PHP 5.
So then the obvious thing to do is write your own parser. Right?
At first I thought it would be simple. But it ended up taking me about 4 1/2 hours just to write a very simple parser. Well maybe you should take into account that I’ve never written something this complex before.
XML isn’t complex in itself but yet writing any kind of parser is fun, in a difficult and challenging sort of way.
So what does this really great and simple parser do? Well it loads an XML file, creates an array from it. You can add elements and get everything back in XML or Array format.I meets my needs, for now. In the future I’ll be able to do a better job.
Uncategorized Uncategorized


