[uf-dev] Singleton Principle during parsing
Tantek Ç elik
tantek at cs.stanford.edu
Mon Jun 26 10:24:40 PDT 2006
On 6/26/06 9:55 AM, "brian suda" <brian.suda at gmail.com> wrote:
> On the discuss list this was brought-up
>
> Tantek Said...
> Take the first one as *the* one.
>
> In general that is the parsing rule for microformats where a singleton is
> required (e.g. single "FN" property). If you find more than one instance
> where you were expecting only one, just use the first instance found.
>
> =====
>
> having parsed a lot of microformats, i think there are two minor things
> that need clarification.
>
> 1) first instance found. XHTML is a tree structure, so that should be
> first instance found in a depth first search, or a breath first search?
> I would assume depth first because that is how it is rendered and how it
> is read by humans.
Depth first AKA document order (XHTML is a linear stream before it is a
tree). Your reasoning is correct.
> 2) how does the include pattern work into this? Since you don't know
> what is being included until it actually parse it, should you look into
> the included code first, or parse everything then include the code?
Include-pattern and table-headers processing occurs BEFORE parsing for
specific properties.
Brian, want to start "hcard-parsing-faq" and add these to it?
Thanks,
Tantek
More information about the microformats-dev
mailing list