
Saxon-Node: Modern XSLT, XQuery and XPath in Node.js - ingve
https://github.com/rimmartin/saxon-node
======
xaduha
Blog post about it.

[http://dev.saxonica.com/blog/mike/2016/02/introducing-
saxon-...](http://dev.saxonica.com/blog/mike/2016/02/introducing-saxon-
js.html)

~~~
bryanrasmussen
I don't think so, it seems the blog post is about compiling down to
JavaScript, therefore can run XSLT 2.0 in the browser using it.

It looks like Saxon-node is maybe leveraging some of the Saxon-Js stuff to
make the node version so that you will be able to use saxon as an API. Hence
the example here of doing XQuery [http://rimmartin.github.io/saxon-
node/tut/executeaquery.html](http://rimmartin.github.io/saxon-
node/tut/executeaquery.html)

------
rosser
I'm sure there are countless incredibly legitimate use-cases for a technology
like this, but there's part of my brain that seriously wants to explode at the
notion of coupling Node and XSLT.

~~~
PeCaN
XSLT is actually insanely cool, it's just poorly executed.

For example, XSLT lets you decouple the content structure of your document
from the presentation structure. XSLT makes nested <div> obsolete. It lets you
have responsive HTML—you can serve different stylesheets to differently sized
browsers (or switch them on-the-fly with JS). In general, what it can do is
cool, but using it is not. If XSLT weren't something of a trainwreck the web
would be in a better place.

~~~
vbezhenar
XSLT is cool "theoretically". It was made to solve real problems with correct
approach. But practical implementation is not cool at all. XML is not good as
a programming language representation.

As an alternative to XSLT consider CDuce language. It was made to solve a
similar problem: XML manipulation. But language itself uses traditional syntax
and much easier to use and understand.

~~~
spdustin
XML is not meant to be a programming language representation. It's meant to be
a predictable, simple set of grammatical rules for representing data that
_may_ be hierarchical/shaped/tree-like. XSLT is meant to provide a library of
templates used to transform XML to something else (usually XML again, but can
be nearly any output format) in a declarative way.

XSL is a _little_ bit like CSS in one way: CSS has selectors, and XSL does
too. CSS also has rules (one or more selectors and the properties listed for
them) that apply to an output device's representation of the nodes matching
those selectors (e.g. a browser's visual styling), and XSL has templates that
_change the structure_ of the nodes that match the XSL template's selector.
Each template has a context, can transform the input "tree" to any
intermediate representation necessary, can apply itself recursively, and can
completely transform the XML-structured input into practically any output
required.

It's also a religion along the same lines as vim/emacs/atom or
Mac/PC/Linux/UNIX/BSD/etc., and thus, discussions decrying the blasphemy of
declarative transformations will result in fervent cries of, "XSL sucks, nuke
it from orbit," as well as equally impassioned speeches that, "XSL kicks ass,
get enlightened!"

------
rmchugh
Would love to see a ruby binding for this, right now we're stuck with XSLT 1.0
via libxml.

~~~
spdustin
If using JRuby, you can use [https://github.com/fidothe/saxon-
xslt](https://github.com/fidothe/saxon-xslt)

