For simple microformats, including the ones that depend on rel-design-pattern
, it should be simple enough to write your own code to parse data from and write data to the appropriate rel
and rev
attributes. It takes a lot more work to handcraft parsers for complicated microformats such as hCard
and hCalendar
because there are many possible properties.
There are no schemas for microformats, only specifications written for direct human interpretation, which makes difficult any autogeneration of high-quality language-specific parsers from the specifications.[313]
A challenge in working with microformats is the lack of validators. Norm Walsh argues that W3C Schema and Relax-NG will not work for the purpose of expressing the syntax of microformats as schemas, though Schematron might be up for the task.[314][315]
Hence, you will need to look for some handcrafted language-specific libraries to handle microformats. Start by looking at http://microformats.org/wiki/implementations
.
Here are some language-specific libraries:
mofo
(http://mofo.rubyforge.org/
) is a new Ruby library that has support for a variety of microformats including hCard
, hCalendar
, and xfn
.
uformats
(http://rubyforge.org/projects/uformats/
) is another Ruby library that has support for hReview
, hCard
, hCalendar
, rel-tag
, rel-license
, and include-pattern
.
For PHP 5, consider using hKit
(http://allinthehead.com/hkit/
), which has support for hCard.
Probably the best library out there is Microformats.js
, which is the heart of the Operator add-on.[316]
There are interesting things to do with Operator, both for what it can do today and for how it might be a harbinger of things to come in Firefox 3 (which might have native support for microformats).[317]
Download and install user-scripts
to add new actions and new microformats (http://?www.kaply.com/weblog/operator-user-scripts/
).
Try your hand at writing new actions or support for new microformats by studying existing scripts and the documentation.[318]
Study the code for Operator to pick up on the subtleties that go into working code using microformats.[319]
[313] http://smackman.com/2006/06/01/an-old-idea/ and http://lists.w3.org/Archives/Public/public-rdf-in-xhtml-tf/2006Jun/0011.html.
[314] See http://norman.walsh.name/2006/04/13/validatingMicroformats for more about validating microformats. Erik van der Vlist adds to this analysis at http://eric.van-der-vlist.com/blog/2277_?Validating_microformats.item.