[uf-discuss] Re: DOM scripting as an alternative to include-pattern?

Scott Reynen scott at randomchaos.com
Mon Jun 5 11:26:02 PDT 2006


On Jun 5, 2006, at 12:27 PM, Michael Leikam wrote:

> could you (or anybody else really)
> explain a little more about the differences you see between
> supporting DOM manipulation during the parsing, as I've
> suggested, and supporting include-patterns?

The include pattern describes simple behavior (include the referenced  
fragment).  DOM manipulation is one specific implementation of that  
behavior, and much more beyond it.

> What is the difference between defining a data
> format and defining what people do with that data format
> (i.e., what that data format is used for)?

I think the important difference is that the former makes  
communication easier and the latter makes communication more difficult.

> But in order for the parser
> to generate the target format, you've defined this
> procedure:
> ---------
> if class is "include", grab the referenced node including
> descendants and replace the current node with the
> referenced one.
> ---------

I think the HTML spec pretty much defines this procedure:

http://www.w3.org/TR/html4/struct/objects.html#adef-data

"This attribute may be used to specify the location of the object's  
data ... a serialized form of an object which can be used to recreate  
it."

Maybe this is a good example of why specs shouldn't be repeated.

> The sort of markup I had in mind was something like this:
> ---------
> <div id="company">
>   <div class="hcard">
>     <h1 class="fn org">Michael's Webby Widgets</h1>
>     <div class="adr">
>     <span class="locality">Los Angeles</span>
>     </div>
>   </div>
> </div>
> <div class="hcard" onUFparseEvent="add_org_and_city()">
>   <div class="fn">Michael Leikam</fn>
>   <a class="email" href="mailto:me at foo.bar">
> </div>
> ---------

This is invalid XHTML.  There is no onUFparseEvent attribute for div  
tags.  We can't just add arbitrary attributes to XHTML, and  
especially not if we expect anyone else to understand what we're  
trying to communicate.

> Adding an ID to span.locality, which I think
> is how include-pattern wants to handle this, isn't
> appealing because I'd want to use a generic hcard generator
> for any contact information.

I don't think that's what the include pattern is for.  You might want  
to look at microtemplates, as it seems to be more what you're after:

http://microtemplates.org/

> But from the replies I've
> gotten, it sounds like this is the beginning of a
> discussion and not something that is already ongoing.

The inclusion pattern is a relatively new introduction to  
microformats.  The object tag is older than microformats.  The  
principle of separating markup from functionality is older than  
microformats.

Peace,
Scott



More information about the microformats-discuss mailing list