[uf-new] [Fwd: Re: [uf-discuss] Re: Precise Expansion Patterns]
Martin McEvoy
martin at weborganics.co.uk
Sun Dec 16 15:09:41 PST 2007
On Mon, 2007-12-17 at 10:56 +1300, Paul Wilkins wrote:
> On Dec 17, 2007 10:23 AM, Martin McEvoy <martin at weborganics.co.uk> wrote:
> > My thought is (after many months of wrestling with this beast) that
> > instead of trying to hide and change what we are doing (after all its
> > necessary) it may be worthwhile trying to find a more semantic
> > equivalent of how we use the <abbr> tag.
> >
> > http://www.w3.org/TR/html401/struct/text.html#h-9.2.1
> >
> > VAR:
> > Indicates an instance of a variable or program argument.
> >
> > We are presented with an instance of a variable, when we do this:
> >
> > <abbr class="duration" title="PT2M23S">2:23</abbr>
>
> No we are not. There is nothing variable about 2:23. It's an absolute
> value of duration.
>
> A variable is a programming term. Here's a sample of how it SHOULD be used.
>
> <pre><code>
> function hide(id) {
> forEach(id, function(id) {
> var el = document.getElementById(id);
> setStyle(el, 'display', '');
> }
> }
> </code></pre>
> <p>I don't want to create <var>el</var> each time this is run. You can
> easily resolve this by passing the
> <code>document.getElementById()</code> directly to the function.</p>
Correct this is exactly what I mean thank you Paul but not quite so
complex. (bet you didn't expect that!)
I am not very good at explaining things but stick with me..
imagine we did just this
<var class="duration">2:23</var>
this is our variable the thing we want to do something with, in your
example you insert el where the <var></var> is, we want the same, an
insert function to work not a page load action but on a people or
machine action
If it were a machine that passed by our var duration it would be hoped
that the function would be to do a string replace and re-present the
data as PT2M23S but truthfully this is too much for us to expect from
our humble parser.
so how do we pass the information to a machine....
<var class="duration" title="PT2M23S">2:23</var>
... the Microformats community are used to passing data to a machine via
the @title its a lot more simple than doing a string replace on the
contents of our var.
in xsl I can now do something like this
<xsl:if test="/*//xhtml:var[@class='duration'] != 0">
<duration><xsl:value-of
select="/*//xhtml:var[@class='duration']/@title" /></duration>
</xsl:if>
which is my simple function.
This is what I mean by using a Semantic Equivalent.
Thanks
Martin
>
>
> When I also list my favourite song of the day, it would be a very bad
> thing for the time to be displayed in virulent green along with the
> actual real var elements in the code.
>
> There is nothing about the time 2:23 that is relevant to the VAR element.
> What is really happening is you are taking a little-used element and
> shoe-horning a false understanding around it to try and make it fit.
>
> That is not acceptable.
>
> --
> Paul Wilkins
More information about the microformats-new
mailing list