Separating data and mark-up - JavaScript versus XSLT
Separating data and mark-up - JavaScript versus XSLT
Posted Aug 28, 2025 8:43 UTC (Thu) by farnz (subscriber, #17727)In reply to: Direction of travel seems to be JavaScript for all of this sort of thing by iq-0
Parent article: The tangled web of XSLT browser support
I, in general, don't really care how you convert the raw data to something pretty for the user to view. JavaScript and XSLT both work for me here, with JavaScript having more flexibility.
The thing that I do want to see more of, and that XSLT was supposed to usher in (but didn't, for a variety of reasons) is a world where the data is separate to presentation. If that's data supplied as XML and transformed into a presentation form by XSLT, great. If it's supplied as JSON, or XML, or CBOR, and transformed into a presentation form by JavaScript code, that's also great.
Key for me, though, is that the data is supplied separately, and that I can, as a hacker type, use the presentation renderer to reverse-engineer the data format and reuse the data in ways the originator did not think of. It's also a nice side-benefit if the presentation layer (whether XSLT, or JavaScript) is highly cacheable, so that the data is small; I'd prefer to get the data in a single TCP packet each time it updates, rather than downloading 200 KiB of "echo" formatted HTML (or 200 KiB of XML for 100 bytes of new data, for that matter).
Posted Aug 28, 2025 16:25 UTC (Thu)
by wahern (subscriber, #37304)
[Link] (4 responses)
Now ask yourself, why is that? What's better technologically for a single outlet is not necessarily better for the health of the broader ecosystem. Technology shapes and channels how players interact. Once upon a time the FOSS world, or at least part of it, understood that. But we've all become utterly inured to centralization and walled gardens that few can even remember the previous era, of which RSS is a vestige. There's an alternative universe where Spotify is the singularly dominate player in podcasting, similar to YouTube and Instagram for video. Would that be a better universe?
Posted Aug 28, 2025 16:50 UTC (Thu)
by farnz (subscriber, #17727)
[Link] (3 responses)
Rather, it's about money. Video and photo sharing centralised because, at the time, bandwidth prices were high compared to the sizes of files; the YouTube and Instagram gambles, (which paid off) were that if you could grow fast enough, you could get enough investment to allow you to stay ahead of the cost curve, up until bandwidth became cheap enough that they could cover their costs from their income.
Had the typical home user had an unlimited usage 100M symmetric connection back in 2004, with 10G being cheap in datacentres, we might well not have seen the centralisation we say, because it would have been cheap to host your video yourself, and therefore extending the podcast ecosystem to a videocast ecosystem would have been something people did.
Posted Aug 28, 2025 18:22 UTC (Thu)
by wahern (subscriber, #37304)
[Link] (2 responses)
Also, I'm admittedly biased because I really do like XSLT. I dislike XML, and dislike XSLT's XML syntax, but in terms of functionality and longevity, even prospectively (alternatives aplenty, but always ephemeral), there's nothing else like it. Saying that browsers don't need XSLT because we have JavaScript is like saying browsers don't need WebRTC or PushAPI because we have JavaScript, WASM, and HTTP 1.1. Sure, but that's beside the point. Even though XML is seemingly in its golden years, I wouldn't be surprised if it's still more ubiquitous in terms of breadth and depth of software support and data encapsulated than JSON. All the world isn't a Rest API. And manipulating XML is much nicer using XSLT & friends (XPath, XQuery, etc). And despite the WHATWG's best efforts, XML and HTML remain sufficiently alike that it strains credulity to suggest XSLT couldn't or shouldn't be a contender for HTML templating.
The most convincing argument against XSLT for me is the lack of well maintained libraries. So what's clearly necessary, if not sufficient, for XSLT to survive is the FOSS community stepping up to fill the vacuum--libxslt successfully revived (thankfully some people are already taking a stab at that), Saxon opening up more and seeing greater adoption, or some newcomer library/ies. Preferably all of the above.
Posted Aug 28, 2025 18:33 UTC (Thu)
by wahern (subscriber, #37304)
[Link]
Posted Aug 28, 2025 19:35 UTC (Thu)
by excors (subscriber, #95769)
[Link]
Following the zero-one-infinity rule, since podcasters have to support more than one platform they'll use a third-party hosting service who know how to publish to all the platforms at once (and how to handle listener stats for all those platforms to attract advertisers, etc), so the minor platforms can still hang on. But I think it's the duopoly of commercial platforms who have allowed the industry to take that shape.
Separating data and mark-up - JavaScript versus XSLT
I don't think any of that is particularly related to XSLT, however. One of the reasons XSLT is so lightly used is that nobody bothered with it back in the day; even now, it's common for RSS feeds to not also have an associated XSLT transform to give you a nice web page if you open the RSS feed directly.
Separating data and mark-up - JavaScript versus XSLT
Separating data and mark-up - JavaScript versus XSLT
Separating data and mark-up - JavaScript versus XSLT
Separating data and mark-up - JavaScript versus XSLT
