PHP, Programming, Technology, Web Programming

Microformats extension to SimpleXML

<![CDATA[I'm writing a PHP5 object that extends SimpleXML to automatically add various microformats. So you could do, for instance, the following:

$xml = SimpleXML_load_file('test.xml');
foreach ($xml->hEvent as $event) {
    print $event->original();
}

This would print the original HTML of every hEvent found in the HTML document.
XML, PHP, PHP5, microformats, hCard, hReview, hCalendar]]>

Advertisements

6 thoughts on “Microformats extension to SimpleXML

  1. <![CDATA[Pascal: Cool, I didn't know I had subscribers… 🙂

    Ryan: I have some but I'm not at home at the moment so I can't get to it. I'm actually converting some code I already had for working with hCalendars and hCards (I only just realised you can pass a custom class to use with simplexml_load_***).]]>

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s