[uf-dev] X2V parsing of #fragment-identifiers

Tantek Ç elik tantek at cs.stanford.edu
Thu Jun 28 17:40:48 PDT 2007


On 6/28/07 3:42 PM, "Brian Suda" <brian.suda at gmail.com> wrote:

>> From the hcard-parsing wiki page[1]:
> 
> "If the URL has a fragment identifier, then the parser should parse
> only the node indicated by the fragment identifier and its
> descendants, looking for hCards, starting with the indicated node,
> which may itself be a single hCard."
> 
> Currently X2V (as i read this spec) does not implement this correctly.
> I want to double check to see if i need to change my code and/or if
> the wiki needs a better description.
> 
> As i read it, you should be able to point to an ID attribute and look
> for a microformat at that ID and for any microformats that are
> children of that ID.
> 
> For instance:
> <h1>Staff</h1>
> <ul id="staff-list">
> <li class="vcard">...</li>
> <li class="vcard">...</li>
> </ul>
> 
> If i submit the URL http://example.org/index.html#staff-list to X2V i
> SHOULD get 2 vCards as a result? At the moment X2V would fail because
> it is looking for:
> <div class="vcard" id="staff-list">...</div>
> Which is ALSO valid according to the wiki page and would yield 1 vCard.

Yes, I wrote that very deliberately in hcard-parsing, for the reason you
outlined, to be able to group hCards on a page, and extract them in groups
as well as individually and in entirety.


> Currently X2V can only extract the FULL page or a SINGLE instance. As
> i read the parsing-rules wiki page, the current implementation is not
> correct.
> 
> This popped-up recently for myself with GEO, i have a page of various
> GEO points. I wanted to generate a KML file of multiple GEO points,
> but only a subset of the FULL list on my page.
> 
> So i am willing to update my XSLT code, but i'd like some feedback to
> whether my implementation is in error, or the wiki page. (i think i
> side with the wiki page at the moment and need to update my code)

The quote from the wiki page is correct.

> [1] - http://microformats.org/wiki/hcard-parsing#URL_handling

Thanks,

Tantek



More information about the microformats-dev mailing list