[uf-dev] Singleton Principle during parsing

brian suda brian.suda at gmail.com
Mon Jun 26 09:55:13 PDT 2006


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.

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?

-brian


More information about the microformats-dev mailing list