[uf-discuss] re: HTML5 support
Stephen Paul Weber
singpolyma at singpolyma.net
Wed Jul 21 07:07:06 PDT 2010
-----BEGIN PGP SIGNED MESSAGE-----
Somebody claiming to be Toby Inkster wrote:
> On Tue, 20 Jul 2010 08:29:48 -0400
> Stephen Paul Weber <singpolyma at singpolyma.net> wrote:
> > Having written significant code both in-browser and out to parse
> > microformats, I find the claim that parsing them using the DOM is
> > "not practical" shocking. What would you prefer?
> Parsing microformats via the DOM is not practical. Parsing them any
> other way is even worse though.
> While writing DOM code to parse a particular site's implementation of
> say, hCard, is pretty trivial, generalising that to support all the
> variations of how hCard is marked up in the wild is a lot of work.
> As a comparison, I have written Perl parsers[*] for microformats, RDFa
> and Microdata. Here are the lines-of-code counts for each, excluding
> documentation, comments and blank lines:
> The amount of code needed to parse microformats is clearly different
> from the other formats.
Sure, but you're comparing apples and oranges. RDF and microdata are more
like JSON and XML: popular but useless by themselves. They're just generic
containers. So, yes, you can trivially parse out the KVPs they encode, but
you have no idea what those are, what they mean, what the relationships
between them are, nothing. So you would have to write more code to
implement each specific vocabulary you were interested in, and do useful
stuff with it. The microformats parsers, because they're parsing an actual
vocabulary instead of a container format, yes there will be some more code,
because both steps are happening at once.
The data you get out is actually the data you want, that makes sense, though.
When I want profile data, I write an hCard parser and grab it. The same
deal with microdata would normally be done with a seperate "generic" parser
and then the code to throw out all vocabularies I don't want, and then the
one to massage into an internal data format that I want the vocabularies
that I do.
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the microformats-discuss