←back to thread

418 points akagusu | 1 comments | | HN request time: 0s | source
Show context
Aurornis ◴[] No.45955140[source]
I have yet to read an article complaining about XSLT deprecation from someone who can explain why they actually used it and why it’s important to them.

> I will keep using XSLT, and in fact will look for new opportunities to rely on it.

This is the closest I’ve seen, but it’s not an explanation of why it was important before the deprecation. It’s a declaration that they’re using it as an act of rebellion.

replies(10): >>45955238 #>>45955283 #>>45955351 #>>45955795 #>>45955805 #>>45955821 #>>45956141 #>>45956722 #>>45956976 #>>45958239 #
zekica ◴[] No.45955351[source]
I used it. It's an (ugly) functional programming language that can transform one XML into another - think of it as Lisp for XML processing but even less readable.

It can work great when you have XML you want to present nicely in a browser by transforming it into XHTML while still serving the browser the original XML. One use I had was to show the contents of RSS/Atom feeds as a nice page in a browser.

replies(2): >>45955386 #>>45956298 #
rwmj ◴[] No.45956298[source]
I would just do this on the server side. You can even do it statically when generating the XML. In fact until all the stuff about XSLT in browsers appeared recently, I didn't even know that browsers could do it.
replies(1): >>45958310 #
wizzwizz4 ◴[] No.45958310[source]
Converting the contents of an Atom feed into (X)HTML means it's no longer a valid Atom feed. The same is true for many other document formats, such as flattened ODF.
replies(1): >>45961310 #
rerdavies ◴[] No.45961310[source]
Is an XLST page a valid atom feed? Is it really so terrible to have to two different pages -- one for the human readable version, and one for the XML version?
replies(1): >>45972985 #
1. wizzwizz4 ◴[] No.45972985{3}[source]
Yes, an <?xml-stylesheet href="..."?> directive is valid in every XML document. You can use CSS to get many of the benefits of XSLT here, but it doesn't let you map RSS @link attributes to HTML a/@href attributes, and CSS isn't designed for interactivity. That's a rather significant gap in functionality.

It is rather terrible to have two different pages, because that requires either server or toolchain support, and complicates testing. The XSLT approach was tried, tested, and KISS – provided you didn't have any insecure/secure context mismatches, or CORS issues, which would stop the XSL stylesheet from loading. (But that's less likely to spontaneously go wrong than an update to a PHP extension breaking your script.)