Microtemplates
Stephen Farrell:
Microtemplates are a way of creating templates in HTML that can be evaluated in the browser. More info here: microtemplates.org.
It seems to me that microtemplates are a no-brainer. I’ve coded enough Javascript like this:
var data = {url:"http://smackman.com",fn:"Steve Farrell"};
var hcard = document.createElement('span');
var link = document.createElement('a');
link.class = "url fn";
link.href = data.url;
link.appendChild(document.createTextNode(data.fn));
hcard.class = "vcard";
hcard.appendChild(link);
to know that given a JSON structure
{vcard:{url:"http://smackman.com",fn:"Steve Farrell"}}
and an associated
microtemplate
<span id="vcard-template" class="vcard">
<a class="url fn"></a>
</span>
with
very little Javascript
var url = "http://rest.service/get/vcard";
new IBM.ET4A.Template("vcard-template").fetch(url);
you’ll get a nice transformation for your web application.
<span class="vcard">
<a class="url fn" href="http://smackman.com">Steve Farrell</a>
</span>
… and that’s money in the bank.
Just imagine the more complex examples like
hAtom and others to come. This is another reason why I was discussing with
Dan Connolly we need a standard mapping from
microformats, RDF,
JSON and XML.
Comments are closed
Comments are currently closed on this entry.