microformats vs yet another xml vocabulary
Geek
Via Planet Jabber, Hal Rottenberg wonders why anyone would bother using XHTML or plain old HTML with Microformats instead of inventing a full-blown XML vocabulary for storing Jabber logs. I started to reply as a comment, but it turned out rather lengthy, so I'll post it here instead.
The main difference between (X)HTML+MF and XML+XSL/CSS is that the latter is backwards compatible with the entire collective installed software base on the Web, whereas the latter is not.
In addition, going with the latter will eventually end up losing either the semantics of the XML or the presentation specified by the CSS or XSL as either the raw XML or the result of the transformation is handled by UAs and other programs (Greasemonkey, search engines, aggregators, etc.) process the markup, which sucks.
I think these are two very compelling reasons, but of course could only be issues for documents available on the Internet, which is what MFs are (should be?) aimed at and here MFs are clearly the better choice.
For an application's private use, a reasonable argument for using MFs might include cases where the files are in user-accessible directories and hence not easily or reliably preposessed before the user tries to open them. I can't think of when this might actually be useful, or even used, however.
In other cases where it is important that the user be able to view the data, it should be straight-forward enough to just transform the XML to HTML or style it directly using CSS. Unfortunately, if the user's browser or an off the shelf HTML rendering component is relied upon to transform and/or otherwsie style the XML data then the same problems with backwards compatibility as on the public Internet can arise. There is also the extra work required for the software's developer in writing and maintaining the code to perform the transformation and the XSL itself, which can be significant.
The same problem with losing semantic information can also arise. If the user wants to, for example, upload the data to a web site then the XML will need to be transformed into HTML and the semantics of the data will be lost. This can be avoided by using a scheme like Microformats, so why not just use HTML+Microformats in the first place?
So it seems to come down to whether there is a chance that the data might want to be viewed in a web browser or not. If so, the using (X)HTML+MF is pretty compelling. Not having to invent Yet Another XML Vocabulary is also nice, but you still have to do basically that when designing a MF (in a more limited form, however). If there is no chance that a web browser or other HTML renderer will be involved, there is little or no point in using Microformats.
Comments
"The main difference between (X)HTML+MF and XML+XSL/CSS is that the latter is backwards compatible with the entire collective installed software base on the Web, whereas the latter is not."
Former? Latter? I'm lost.
Posted by: Dave on August 15, 2006 05:56 PM
Oh come on, that should be easy to parse. Remember BODMAS?
Posted by: Mike on August 15, 2006 10:33 PM
Personally I think its highly unlikely that normal users are going to be uploading their Jabber logs to the web, and even if they want to its far easier to just have an option in the users client for "Export to HTML" as users are very unlikely to be wanting to upload their entire log file, they will just want to upload snipets of it, and its far more user friendly to deal with that within the client than making the user edit the log file themselves for uploading it, thats assuming they even have the understanding to do that themselves.
Posted by: Richard on August 16, 2006 01:34 AM
Yep, that's my feeling as well. It would be nice if the export used Microformats to preserve the semantic information when published on the Web, however. This would allow other people to extract useful information from the HTML version of the log - useful for things like minutes of meetings, perhaps.
Posted by: Mike on August 16, 2006 09:06 AM
Cool, that also means that there is no need to use microformats in the file format that the client uses for storing the raw log files on disk, it makes far more sense in a the jabber world to use a defined xml format that is far more easier to process and extend cleanly in future than a microformat.
although there is also the argument that you could just use xslt to transform the log file into html and that could even be done in the browser, it works fine in IE, i would expect that firefox would be fine too.
Posted by: Richard on August 16, 2006 05:45 PM
And yeah, that XSLT trick would work real well on my Blackberry too, right?
Posted by: Chris Messina on August 17, 2006 04:37 PM
Add a Comment