[uf-discuss] Proposal: Implied "ADR"

Andy Mabbett andy at pigsonthewing.org.uk
Wed Jan 16 15:57:36 PST 2008


Given the usefulness of hCard's "implied n" and "implied
organization-name" optimisations, could we have a parallel "implied
"ADR" ?

It could work in one of two ways:

   *    Inside a "vcard" element, where no ADR is present, any *single*
        child-of-ADR is assumed to have an implied "ADR" around it.

or:

   *    Inside a "vcard" element, where no ADR is present, *all*
        child-of-ADR elements are assumed to be within a single "ADR"
        [and should be concatenated per Brian Suda's recent proposal, if
        the latter is adopted]


such that, in either case:

                <foo class="vcard">
                    <span class="fn">
                        John Doe
                    </span>
                    lives in
                    <span class="locality">
                        Birmingham
                    </span>
                ipsum
                </foo>

results in:

                fn = John Doe
                adr
                  locality = Birmingham

and in the second case:

                <foo class="vcard">
                lorem
                    <span class="fn">
                        John Doe
                    </span>
                    lives in
                    <span class="fn locality">
                        Birmingham
                    </span>,
                    <span class="country-name">
                        England
                    </span>
                ipsum
                </foo>

results in:

                fn = John Doe
                adr
                  locality = Birmingham
                  country-name = England


Thereby also reducing the amount of mark up need to convey a single
place-name from three levels of nesting:

                <foo class="vcard">
                  <span class="adr">
                    <span class="fn locality">
                        Birmingham
                    </span>
                  </span>
                </foo>

to two:

                <foo class="vcard">
                  <span class="fn locality">
                        Birmingham
                  </span>
                </foo>

which neatly equates to the two levels needed to convey a person:

                <foo class="vcard">
                  <span class="fn">
                        John Doe
                  </span>
                </foo>

or organisation:

                <foo class="vcard">
                  <span class="fn org">
                        Acme
                  </span>
                </foo>


"ADR" would still be available where a vCard contains more than one
address.

-- 
Andy Mabbett


More information about the microformats-discuss mailing list