• Well I’ve searched the Codex, and couldn’t find anything. Does WordPress have any built in functions for reading/parsing XML documents? I could write my own for my plugin, buy why bother if the functions are already available for the plugin to use.

    – Sean

Viewing 6 replies - 1 through 6 (of 6 total)
  • wordpress itself I believe uses Magpie for parsing things like RSS feeds, while I steer people toward my CG-FeedRead solution if they want something lighter-weight.

    FeedRead uses quick-n-dirty hand-crafted parsing, leveraging early PHP extensions. I’m not sure, but I thought magpie maybe used the DOM XML parser (another PHP extension) — certainly I have seen a number of people use xtree or other compiled traversals.

    All depends on what you want to do, how ‘heavy a load’ you want for doing it, and how much extra code you want to write. 😉

    -d

    PHP5
    and SimpleXML
    http://php.net/simplexml
    🙂

    That presumes PHP5 (which still isn’t widespread), and that you know the construction of the XML. Which is why it’d be good to find out what XML is he looking to parse. 😉

    Thread Starter forceagainstsomething

    (@forceagainstsomething)

    Thanks for the responses. While SimpleXML would be a great solution, like davidchait said, that would make my plugin unusable for people not running PHP 5.
    If WordPress uses Magpie, then that’s great. But I need to know the names of the XML functions and their API. If I knew which include file the functions were defined it, I could look into it myself.

    Thanks!
    – Sean
    http://www.headzoo.com

    /wp-includes/rss-functions.php

    I Use DOMIT xml parser to write my plugin.
    It’s written purely in PHP and should therefore run on any Web hosting platform with PHP 4 and above installed.

    Take a look at http://freshmeat.net/projects/domit/

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Build In XML Parser?’ is closed to new replies.