-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Somebody claiming to be Toby Inkster wrote: > On Tue, 20 Jul 2010 08:29:48 -0400 > Stephen Paul Weber <singpol...@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) iQIcBAEBCAAGBQJMRv8JAAoJENEcKRHOUZze7lYP/A9AD+Vnwy2mEM+zOB7QITFc FlrVzGksiOnIyPtKIXgMG8Sm8doPRrG8JC0RtCA7V3BhVmNR8dry+5A8PCCpLOyl 8CUym6G10RYduQQ0rdQCYMB6E37BgAq3Vl9oi9xUSZwsbJepEdIrSeifUZnbYtA0 ZMD/ADmLBYyqeHUf1/0So/m7W4vxtki7eUX0i95YgW997AFntKYZBfY2gtOTvvur Cx53jMWGkZdNgvGg/Mc9eyR011bPec7RtDkbYJJoUaVCiezxk1wFhzR6lLgcoRyB ZM4zEIBAOGS3UrT+pchX6OYGpL/3JGdCFdUkFPLbQlH1lOO1X1brogS3rJRDIyGk X1DQu0Md0b03vzw/wW5tIs93TCN2uGjiwXjC4ytFY7wuk9K9vwtZQQL6O8a9dJTf 9QFdGopQvn5YIFbVK/3p+9lPJUmu4+BljEDSVtQYzT0RA3b/qXvgJmqOzYBau9Eo 2YczFkjF69y3llaX5zAoOmQHhD1uKYjZUbOj+8fHZSKccPSwZXuXnR+sSrWlm3nR Hr81QftUoO3IztBqargQVXbDiW+f+BItb1xPm343sxiFSVfXDFtcUp2kaEvF39no LAG/XPnLDhV9FtDTwXwbhbfBQ4dCxRxQIkwfD8Jf5uFVLyWfpyB3+90yEdPVjhnO wb76GF2GtcZiGY/5J/AN =ORD1 -----END PGP SIGNATURE----- _______________________________________________ microformats-discuss mailing list microformats-discuss@microformats.org http://microformats.org/mailman/listinfo/microformats-discuss