Saturday, November 18th, 2006
SXOOP.template
Walter Higgins is a believer in having a template language for you to use within JavaScript. He had issues with TrimPath's templating system, so he ended up creating SXOOP.template:
Writing TinyTemplate in Perl was a breeze and the codebase is tiny. I used a similar approach to writing SXOOP.template which resulted in a tiny codebase for the Javascript version too.
What need for Javascript Templating you ask ?
Well, JSON gives Javascript Templating something to do. More and more webservices are supporting JSON.
What’s more; if you combine SXOOP.template with this brilliant XML javascript library, then suddenly javascript templating becomes 1000 times more useful (most existing WebServices use XML). You can mix and combine XML data sources (like the ubiquitous RSS and less well known formats like OPML) and use them to construct Human-readable web-pages without resorting to XSLT.
Example template usage
This example snippet is taken from the poor mans blog template
The entire library is here at 82 lines of commented code.












why not just use standard javascript to achive much the same thing without the 82 lines of code? Or am i missing the point?
Think about developing large and flexible RIAs. When their behaviour depends heavily on external data sources (via RSS, OPML, JSON ans alike) templates come in handy. They’re also quite helpful in designers+developers cooperation.
actually, i do not like php.
the code page is not easy to read at all.