←back to thread

392 points _kush | 1 comments | | HN request time: 0s | source
Show context
badmintonbaseba ◴[] No.44394985[source]
I have worked for a company that (probably still is) heavily invested in XSLT for XML templating. It's not good, and they would probably migrate from it if they could.

  1. Even though there are newer XSLT standards, XSLT 1.0 is still dominant. It is quite limited and weird compared to the newer standards.

  2. Resolving performance problems of XSLT templates is hell. XSLT is a Turing-complete functional-style language, with performance very much abstracted away. There are XSLT templates that worked fine for most documents, but then one document came in with a ~100 row table and it blew up. Turns out that the template that processed the table is O(N^2) or worse, without any obvious way to optimize it (it might even have an XPath on each row that itself is O(N) or worse). I don't exactly know how it manifested, but as I recall the document was processed by XSLT for more than 7 minutes.
JS might have other problems, but not being able to resolve algorithmic complexity issues is not one of them.
replies(9): >>44395187 #>>44395285 #>>44395306 #>>44395323 #>>44395430 #>>44395839 #>>44396146 #>>44397330 #>>44398324 #
nithril ◴[] No.44395839[source]
XSLT/XPath have evolved since XSLT 1.0.

Features are now available like key (index) to greatly speedup the processing. Good XSLT implementation like Saxon definitively helps as well on the perf aspect.

When it comes to transform XML to something else, XSLT is quite handy by structuring the logic.

replies(4): >>44396155 #>>44396595 #>>44396741 #>>44401752 #
echelon ◴[] No.44396741[source]
XSLT just needs a different, non-XML serialization.

XML (the data structure) needs a non-XML serialization.

Similar to how Semantic Web's Owl has four different serializations, only one of them being the XML serialization. (eg. Owl can be represented in Functional, Turtle, Manchester, Json, and N-triples syntaxes.)

replies(6): >>44396991 #>>44398887 #>>44399018 #>>44399237 #>>44399762 #>>44399922 #
1. j45 ◴[] No.44399922[source]
This is very understandable, where I get left at is the remaining gap between XML and XSLTs and where JSON or another format can cover.

Trying to close the gap often ends up creating more complexity than intended, or maybe even more than XML in some hands.

It definitely would be an interesting piece.