Re: Re: XML parser for PHP5
| From: | Matthew Sims | Date: | Wed, 15 Sep 2004 21:19:25 +0000 |
| Subject: | Re: Re: XML parser for PHP5 | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196790@lists.php.net to get a copy of this message | ||
> Matthew Sims wrote:
>
>> Anyone know any good XML parsers that work with PHP5? Most of what I can
>> find on freshmeat are still using PHP4 classes and Google isn't turning
>> up
>> much either.
>
> What do you want to do? This parses xml pretty well:
>
> <?php
> $parsed = simplexml_load_file('filename.xml');
> ?>
>
> as does this
>
> <?php
> $dom = new DOMDocument;
> $dom->load('filename.xml');
> ?>
>
> The first one is brilliant for reading xml whose structure you know, the
> second is better for xml whose structure you wish to manipulate or
> transform.
>
> best, it's built into PHP. If you want a system that can be easily
> serialized and unserialized as an object (as in sessions), you're
> probably best off using XML_Serializer from PEAR, as neither simplexml
> nor DOM retains any useful information when serialized and unserialized.
>
> Greg
>
My fault, I should have been more specific. An RSS reader. :) I was using
xmlParser-0.3 and feedParser-0.5 to display news sites. Since I've
converted to PHP5, they no longer work for me.
--
--Matthew Sims
--<http://killermookie.org>