An alternative approach to XUL's own templating system is to use JavaScript templates.
This approach also provides a separation of formatting and structure from content, but relies on a JavaScript templating engine to have JavaScript-side business logic inject content into a template. And this does not require any use of RDF/XML, etc.
By syntax style
100% Standards-based (no custom syntax)
Pure JavaScript (JavaScript function calls generate HTML)
Note that such solutions can still allow for iteration to match other templating engines using succinct inline for-each constructs or the like by using Array iteration methods such as map or reduce.
- JsonML (without "Browser-Side Templates"); also can be used with JavaScript's JSON subset.
- Jamilih (similar to JsonML)
- domMaster and nodejs master_texthtml
- Mootools Template Engine (null-tech.com)
Pure HTML (JavaScript selectors in business logic find normal HTML to populate)
- PURE
- mustache (has some design logic, but brief syntax)
- Chain.js (dead link); explained here
- LightningDOM
- Mootools Template Engine (zealdev.wordpress.com)
XSL
- XSLTJS (for cross-browser use of XSL for templates)
E4X
- E4X for templating (though note E4X is deprecated)
Standards-friendly (custom attributes or embedding syntax, but uses mostly standard-compatible approach)
X/HTML/E4X/XUL with Namespaced custom attributes and elements
- Adobe Spry processing instruction attributes
- ASP.NET client templates
- Seethrough (uses E4X with namespaced attributes and elements; though note E4X is deprecated)
- XUL Templates (XUL-only)
Pure JavaScript embedded within HTML/XML design logic (ASP/JSP/PHP or curly braces style)
Custom approach
HTML+Curly braces {} with custom design logic
- ASP.NET client templates
- Templates in ExtJS (dead link; obtained via archive.org)
- JavaScriptTemplates
- JSmarty (a system based apparently more closely on Smarty, with many more functions, and with more recent contributions)
- jQSmarty: jQuery Smarty Plugin (dead link) (introduced here)
- JS Repeater
- JTemplates
- mjst
- Mjt
- mustache (thanks to janl)
- Templates in JQuery
- Templates in Prototype
- Whiskers.js
- Paperclip
HTML + Non-namespaced custom elements or attributes
ASP/JSP-style custom design logic within <%...%>
- JavaScript Micro-Templating syntax similar to (asp|jsp|php)
- BetterJavascriptTemplates
- PureJSTemplate
- JSONML Browser-Side Templates
- BabaJS
- Templates in Prototype
By feature
Transforming an entire document into another through element/node matching templates
XSL
- XSLTJS (for cross-browser use of XSL for templates)
Generating DOM tree via JavaScript
- Monkberry with server precomiled templates, mustage-like syntax.
Document Tags and Contributors
Contributors to this page:
davidcana,
Anton_Medvedev,
david-mitchell,
crcn,
Brettz9,
kerneljames,
gsf,
Vflash,
amir_harel,
marsch,
zorkzero,
20after4
Last updated by:
davidcana,