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

Costello, Roger L. costello at mitre.org
Tue Oct 31 04:23:13 PST 2006


Hi Folks,

Does anyone have thoughts on the below issue I raised a couple days
ago?  /Roger

-----Original Message-----
From: Costello, Roger L. 
Sent: Sunday, October 29, 2006 6:16 PM
To: microformats-discuss at microformats.org
Subject: Best practice for the "value" subproperty

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