Welcome to libslax, an open-source implementation of the SLAX language. SLAX is an alternative syntax for XSLT which is tailored for readability and familiarity, following the style of C and Perl. Programming constructs and XPath expressions are moved from the XML elements and attributes used in XSLT to first class language constructs. The overabundance of angle brackets and quotes is replaced by the parentheses and curly braces which programmers have enjoyed since the birth of "C". The strength of SLAX is lies in a few key concepts. First is the declarative nature of the XSLT language. Output content and control statements are interwoven in a natural way that makes the generation of XML content simple. Second the use of XPath expressions and their place as a first-class concept in SLAX. XPath expressions are used for conditionals in control statement (if/for/for-each) as well as template and function arguments. Finally, the syntax is familiar and readable. SLAX allows you to:
The benefits of SLAX are particularly strong for new developers, since it puts familiar constructs in familiar syntax, allowing them to concentrate in the new topics introduced by XSLT. Here is a simple example script: version 1.1; /* All scripts start with "version" */ The XSLT version of this script is also available, and the "slaxproc" program can be used to easily convert between the two formats. Complete documentation for the SLAX language is available. libslax includes the "slaxproc" utility, which can be used to run scripts and to convert between XSLT and SLAX. "slaxproc" also includes a gdb-like debugger and a simple profiler. Origins of SLAX SLAX was originally developed as part of the Juniper Networks' JUNOS Operating System. It is used for on-box scripting to allow users to customize and enhance the CLI.
Our customers were unhappy with the XSLT syntax and wanted something simpler and more readable. With SLAX, we were able to give them that, and are now happy to be able to share this as an open-source project. libslax is written in C, and is built on top of Daniel Veillard's most excellent libxml2 and libxslt libraries. Links libslax is hosted by github as https://github.com/Juniper/libslax (releases, docs, wiki, discussions). |
Welcome to libslax.org!
Subpages (1):
Announcements