Stapling is a JavaScript library that enables XSLT formatting for JSON objects.
Instead of using a JavaScript templating engine and text/html
templates, Stapling gives you the opportunity to use XSLT templates - loaded asynchronously with Ajax and then cached client side - to parse your JSON datasources. By using XSLT you are using a uniformed language with a W3C specification, available to render the same output on both server side and client side using the same templates - compared to all different JavaScript templating engines that uses their own template markup.
The library is tested in:
- Firefox 10, 11, 12
- Chrome 17, 18
- IE 8, IE 9
- Safari 5
- Opera 11
IE 7 is supported if JSON (https://github.com/douglascrockford/JSON-js) is available, as well as a localStorage fallback (https://github.com/marcuswestin/store.js).
From v1.5 Stapling now supports some events; before a request is sent a request
event is propagated and before parsing a JSON collection with a XSLT template, a parse
event is raised.
The events can cancel the current task by returning false
, so the library is now more dynamic. To see the events in action, see the example files.
Happy coding!