[uf-discuss] Best practice for the "value" subproperty

Costello, Roger L. costello at mitre.org
Sun Oct 29 15:16:27 PST 2006


Hi Folks,

Suppose that I want to markup this HTML text using the hCard
properties:

         John will be our speaker.  Mr. Public will talk about ...

Notice that the name (John Public) is not consecutive, it is scattered.
To extract the name from this text we use the "value" subproperty:

Design #1

<span class="fn">
        <span class="value">John </span>
        will be our speaker.  Mr. 
        <span class="value">Public</span> 
</span> will talk about ...

The value of "fn" is the concatenation of the "value" subproperties:

    fn = concat('John ', 'Public') = John Public

Notice the space after John.  This enables the fn value to be
formatted.

An alternate design is to remove the space after John and use a "spacer
value":

Design #2

<span class="fn">
        <span class="value">John</span>
        <span class="value"> </span>
        will be our speaker.  Mr. 
        <span class="value">Public</span> 
</span> will talk about ...

The value of "fn" is the concatenation of the "value" subproperties:

    fn = concat('John', ' ', 'Public') = John Public

Notice that now there is a concatenation of three values, the middle
being a "spacer value."

Which is best practice - design #1 or design #2?

/Roger



More information about the microformats-discuss mailing list