←back to thread

392 points _kush | 1 comments | | HN request time: 1.018s | 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 #
agumonkey ◴[] No.44395430[source]
It's odd cause xslt was clearly made in an era where expecting long source xml to be processed was the norm, and nested loops would blow up obviously..
replies(1): >>44395643 #
j16sdiz ◴[] No.44395643[source]
It was in the era when everything walk on the DOM tree, not streams.

Streaming is not supported until later version.

replies(1): >>44395771 #
agumonkey ◴[] No.44395771[source]
Hmm my memory is fuzzy but I remember seeing backend processing of xml files a lot around 2005.
replies(2): >>44395826 #>>44396666 #
count ◴[] No.44396666[source]
Yeah, I was using Novell DirXML to do XSLT processing of inbound/outbound data in 2000 (https://support.novell.com/techcenter/articles/ana20000701.h...) for directory services stuff. It was full XML body (albeit small document sizes, as they were usually user or identity style manifests from HR systems), no streaming as we know it today.
replies(1): >>44396918 #
1. agumonkey ◴[] No.44396918[source]
Ok, I never heard of the pre and post xml streaming era.. I got taught.