Value Excerption Pattern Parsing (was: [uf-dev] How do we (want to) document parsing?)

Brian Suda brian.suda at gmail.com
Fri Jun 13 01:14:31 PDT 2008


On 6/12/08, Michael Kaply <mkaply at us.ibm.com> wrote:
> Do we want to do a final collapsing of whitespace after everything is
> concatenated?

--- that's a good question? right now this is what i do (not to say it
is the best way)

>  Like if the values are:
>
>  <value> Michael </value><value> Kaply
>
>
>
>  </value>
>
>  It would end up as:
>
>  <>Michael Kaply<>

--- in my case i would take the full first value " Michael " and
concatenate that with " Kaply


" then do a trim on the result. So i would drop the leading and
trailing white-space, but preserve the double space in the middle of
the name. My result would be "Michael  Kaply" it is debatable if that
is correct or not.

>  Note that
>
>  <value> Michael</value><value>Kaply </value>
>
>  would be
>
>  <>MichaelKaply<>

--- correct. I don't personally like the idea of adding a space by
default. I tend to use value for things like phone numbers or email

<value>123</value>-ABCD(<value>5678</value>)
<value>brian</value>do_not_spam_me<value>@suda.co.uk</value>

adding a space by default would be incorrect in these instances.

>  This would be similar to how we clean up whitespace in other properties.

--- most of my value output is concatenated, then something like
trim() is applied and only removed the leading and trailing
white-space, but preserves any internal white-space. If the person is
explicitly adding the spacing into the values, then we should probably
honor that.

-brian

-- 
brian suda
http://suda.co.uk


More information about the microformats-dev mailing list