WelcomWeb / Stapling

Parse JSON with XSLT, and forget about JavaScript templates and template engines!
22 stars 6 forks source link

Stapling, parsing JSON with XSLT

Stapling is a JavaScript library that enables XSLT formatting for JSON objects.

About

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:

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).

New in Stapling 1.5

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.

Examples

See the example files

Happy coding!

githalytics.com alpha