[uf-discuss] Value excerpting - thoughts and random observations

Toby A Inkster mail at tobyinkster.co.uk
Wed Apr 16 03:28:02 PDT 2008

I've been noodling with value excerpting recently, as Cognition's  
support for it has been limited until recently -- it was only  
supported for .vcard .tel, .vcard .email and .vcard .impp, but I  
realised that I really needed it for .vfreebusy .freebusy and so  
decided to generalise it to pretty much all properties.

Here are some interesting observations:

	<span class="fn n">
		<span class="given-name">Toby</span>
		<span class="additional-name"><span class="value">A</span>.</span>
		<span class="family-name">Inkster</span>

Value excerpting here is used so that the dot displayed after the  
middle initial isn't taken to be part of the additional-name, yet it  
displayed as part of the formatted name. Unintentional consequence:  
FN is parsed as simply "A". I've not tested other parsers, but I  
assume that the results are similar. Of course, a better way of  
marking it up would have been:

	<span class="fn n">
		<span class="given-name">Toby</span>
		<span class="additional-name">A</span>.
		<span class="family-name">Inkster</span>

Not using value excerpting at all.

Consider <abbr> versus "value":

	<span class="fn"><abbr title="Toby A. Inkster"><span  


Under my interpretation, FN is "Toby A. Inkster". The span with class  
"value" is ignored, as it is the child of an <abbr> with a non-empty  
title attribute.

Yet <abbr> versus "value" can be used for good as well as evil.  
Consider this:

	<span class="dtstart">
		1 October 2008
		<abbr class="value hyper" title="20081001"></abbr>

With the CSS abbr.hyper{display:none;}.

This uses existing microformats patterns (value excerpting, abbr  
pattern) to create a more accessible alternative to the abbr/datetime  
pattern. Because it uses existing patterns, it should work in  
existing tools. *Should*, not necessarily *does*! Works in my current  
unreleased version of Cognition. (Which I'll be releasing as soon as  
the RDFa group get around to updating their syntax document with  
their recently decided changes.)

Another thought: what to do about this?

	<span class="fn">
		<span class="value">
			<span class="value">
				Toby A Inkster

Should the FN be:

	"Bar Toby A Inkster"
		Ignoring the inner class="value".

	"Bar Toby A Inkster Toby A Inkster"
		Parsing both values and concatenating them, as if they were not  
nested. Cognition currently does this.

	"Toby A Inkster"
		The outer "value" itself is subjected to value excerpting.

Or do we simply say that the parsing of such a construct is  
undefined, so authors must not use it? And then let parsers handle it  
however they like, reasonably confident that they will never run into  
such a construct.

Toby A Inkster
<mailto:mail at tobyinkster.co.uk>

More information about the microformats-discuss mailing list