Singpolyma

XOXO (A Semantic Weblog)

Archive for the "XOXOBlog" Category

Datatypeing

Posted on

There is some work going on at the microformats site to provide a datatypeing mechanism for microformats. XOXO being the most flexible format, it stands to gain much from such a system. While the work is as yet not done, it has come a fair way since I first saw it. Here is a basic overview of the system as it applies to XOXO :

Add the class ‘typed’ to the root XOXO element to specify that this XOXO makes use of datatypeing. Then, to each ‘a’ or ‘dd’ tag add one of the following classes:

  • ‘string’ for strings (this is the default if you do not specify a datatype class)
  • ‘boolean’ for boolean values (should be in page as ‘1’ or ‘0’)
  • ‘int’ or ‘long’ for integer values
  • ‘double’ for decimal values
  • ‘datetime’ for dates and times (should be encoded using the datetime-design-pattern)
  • ‘binary’ for binary data (should be encoded using a data URI)
  • ‘nil’ for NULL values

Note that other field types (such as HREF and TITLE) will simply always be treated as strings and this can only be applied to the direct contents of ‘a’ or ‘dd’ field-tags.

Outline Classes

Posted on

The list of XOXO Developer’s Resources has been updated to include the Outline Classes. Written in PHP4 but with compatability built in for PHP5 this set of classes is designed to be able to parse and create XOXO, OPML, hAtom, JSON, and arbitrary XML documents and fragments. The classes are GPL‘ed.

XOXO Blog Format Updated

Posted on

The XOXO Blog Format has been updated to be compatible with hAtom 0.1. The Basic Blogger Template and the template for this blog have also been updated. Please note that the new template is not quite valid hAtom, since the ‘updated’ field is just your Blogger post timestamp format and not proper datetime-design-pattern. This will be fixed as soon as a way to output properly-formatted dates from a Blogger blog is found or the hAtom spec is changed. All applicable XOXO Data Tools either have been updated or will be updated shortly.

How Can XOXO Be Used?

Posted on

XOXO is the most abstract and extensible of all the microformats. While what it can be used for certainly is not infinite, and there are some things it should not be used for, it can certainly be used for a great many varying applications. This post intends to be a discussion of some examples of such use cases.

No Available Microformat
If you want to mark up a part of a webpage in a structured way, either because you feel that a reason for someone wanting to write code to parse the data is probable, or because you wish to write such code yourself, you should first check the microformats list for an existing microformat dealing with your data type. If no suitable microformat exists, XOXO may be the answer. Be careful however, if your particular usage can be generalised into something common across the web that would benefit from standardised markup you may have a candidate for suggesting a new microformat.

XOXO can usually easily be styled using CSS to look the same as a non-XOXO page. This combined with the ease of parsing the format makes it very useful in most cases where data needs to be parseable but there is no existing microformat available. It is reccomended to use ‘standard’ fields (fields not included in the optional DL-list element) wherever possible, however whether or not to use anchor tags when there is no HREF is debateable.

Extending Existing Microformats
XOXO can also be easily used to extend existing microformats. For example, the XOXO Blog Format complies fully with the hAtom microformat, but also adds options for more data to be encapsulated. XOXO is very useful for this because its markup can easily be made to comply with most other microformats, meaning that parsers of the microformat in question will be able to handle it just fine, while XOXO parsers will be able to extract the extra data as well. In addition to this, if the extra data provided by the XOXO extension is stored in ‘Alternate-A fields’, and not in ‘DL-fields’, most microformat parsers can be easily modified to support the extra fields without strict XOXO compliance.

When not to use XOXO
There are a couple reasons not to use XOXO to mark up your data.

  1. If there is an existing microformat that will serve your purpose as it is (check the microformats list)
  2. If your use case qualifies for the creation of a new microformat

Convert XOXO Blog Format / hAtom to RSS2.0

Posted on

hAtom2RSS is a script that takes the URL to an XOXO Blog Format or hAtom blog and generates an RSS 2.0 feed for posts. The script supports all XOXO Blog Format extensions to hAtom. It also generates comments, wfw:commentFeed, and slash:comments tags when the appropriate data is available in the page.