[microformats-discuss] Two usage scenarios

Bud Gibson bud at thecommunityengine.com
Mon Jul 11 07:29:15 PDT 2005

On Jul 11, 2005, at 5:16, Julian Bond wrote:

> 2) I'd like to start putting hCard data into our member profiles. I  
> already have FOAF and vCard available. The catch here is that the  
> basic page probably doesn't validate and by the time the user has  
> inserted some fairly arbitrary html into their free form notes  
> field, it almost certainly doesn't validate. The next problem is  
> that laying out the human readable version doesn't quite lend  
> itself to making the tags hCard compatible. So what I'm thinking is  
> to link (rel alternate) to a separate hCard URL that contains a  
> simple cut down version of the profile page containing just the  
> hCard data where I would have complete control of both the html  
> display and the hcard tags. Does this sound like a good idea?  
> Lastly, I can't see any good tags in the vCard spec or elsewhere  
> for defining a free form "long bio" (type TEXT in Mysql terms) data  
> item containing limited html. Is there one?

Brian Suda's solution in X2V is to use an XSLT transformation on the  
whole page looking for hCalendar and hCard markup.  You point up the  
obvious issue that pages have to be at least well-formed (elements  
properly nested, no illegal characters, legal element names all from  
a purely xml perspective) for this type of solution to work.  Here's  
the link to the Suda page:


Therefore, what you are proposing makes a ton of sense in light of  
existing tools.  It would seem you could adapt Suda's mechanism to  
your case.

I'll also point out that modern browsers do a decent job with  
imperfect DOM trees (i.e., pages with unclosed elements, illegal  
characters, etc.).  There might be a strategy that involved using the  
browsers native DOM parsing capacities, but that would likely lead to  
browser specific solutions.


More information about the microformats-discuss mailing list