hello friends. i am developing a couple of components for a site and I am generating RSS feeds to output data from my database. Some of these comoponents will need to read the xml to display such data, saving me another db call as the rss feeds will be cached.

i quickly found out that I have multiple choices for parsing and I am not sure which one is right for me needs. i started using the DOMDocument class but later found out that the class is not always accessible and must be installed in some cases.

i have seen other like SimpleXMLElement but still not sure if that's the one i should use. i have 1 feed that is super simple, 1 item in the RSS feed and SimpleXMLElement seems like the right one.

I will also have another feed that may have up to 128 items. Is SimpleXMLElement the right one for that size or should I be looking at another method??

    I was reading something that said

    The DOM XML parser functions are part of the PHP core. There is no installation needed to use these functions.

    But when I ran the script on the live server (not mine), i get this error message

    Fatal error: Class 'DOMDocument' not found in

    it is this that brought me here and brought to see how many different options there are and how often people make their own object to array functions.

      Yeah, I would recommend using SimpleXML. PHP 5 and libxml are required, but in my experience most hosts have it.

        You might want to look into an RSS-specific, 3rd party package for PHP, such as Magpie RSS.

          PS: Are you running PHP 5? The DOM and SimpleXML extensions are only available at 5.0 and 5.0.1, respectively. (If you are still on PHP 4, it's time to upgrade or switch hosts to one that is, as 4 has been completely unsupported for quite some time now.)

            thanks for the link and yes, they have PHP 5 installed, I think it was PHP 5.3.x

              back to my second post, php-xml was not installed on the server, which caused the error message:

              Fatal error: Class 'DOMDocument' not found in ....
                Write a Reply...