Oh, that would be something! All I want is to be able to make a website with some reusable elements and simple styling and keep adding content for decades, without having to think about keeping up with upgrades, dependencies and shifting framework paradigms.
I have made a couple of simple websites using PHP to bolt on reusable elements (header, footer, navigation), just because it is the solution that probably will work for ~decades without much churn. But XSLT would be even better!
The <template> element combined with the `cloneNode` works quite well for this. I've got a simple function which can take templates, clone them, fill in nodes with data from a structure, then prepare it to be added to the page.
Works a treat and makes most frameworks for the same seem completely pointless.
Includes are the feature of PHP that made it catch my eye many years ago. Suddenly not having to duplicate shared headers, footers, etc and keep it all up to date across my sites was magical. I could only barely write code at all back then but mixing PHP includes into otherwise plain HTML felt natural and intuitive.
I realize JS might not be to everyone's taste, but I think I've found the absolute minimal JS solution to reuse headers and footers: https://vladimirslepnev.me/write It's almost exactly like PHP but client side, there's no "flash of content" at all.
that's neat. i don't like inline js though. i'd like to be able to load it from a separate file so that i can reuse it on multiple pages.
i am thinking of something like
index.html
<div><navigation/></div>
index.js
function navigation() {
document.querySelector('navigation').replaceWith('<a href="...">...')
}
or maybe
let customnodes = {
navigation: '<a href="...">...',
...
}
then add a function that iterates over customnodes and makes the replacements. even better if i could just iterate over all defined functions. (there is a way, i just didn't take the time to look it up) then the functions could be:
function navigation() {
return '<a href="...">...'
}
and the iterator would wrap that function with the appropriate document.querySelector('navigation').replaceWith call.
PHP is a bit more fragile than it used to be. It is probably a bit for the best but I've had to fix a lot of my 2010-era PHP code to work on PHP 8.x. Though... like, it wasn't super hard. The days you could just start using a variable passed in a URL without setting a default if it wasn't...
That would really be a surprising turn of events, and what a turn it would be! Imagine if the next generation of browsers supported XSLT 3.0—entire cabinets full of blog engines, static page generators, and much more could be rewritten. I support this. XSLT is one of those technologies that is too good to disappear. On the contrary, while some JavaScript frameworks have already turned to dust, I can still rely on my XML toolchains to work in 40 years' time.
Ancient history for me but once upon a time my company was developing a web application with C++ that used XSLT to render HTML (with our "API" exposing data via XML). It was fast even then, and gave us a great deal of flexibility. We were certainly fans of XSLT.
I read the Wikipedia on xslt, and as a long time web developer i do not understand at all how this would be useful. Plenty of people here are saying if this tech had taken hold we'd have a better world. Is there a clear example somewhere of why and how?
I think if you're of the belief that JavaScript is bad and should be avoided when possible this type of thing is seen as an alternative to that. But we've seemingly moved on to server side templating, or dynamic JavaScript apps which solve the problems that XSLT does in a more ergonomic and performant way. Compiling XML templates on the server or at build time is perfectly fine and doesn't require browser support. Doing it on the client leads to performance issues that we saw first hand with older SPA architectures, and if that isn't an issue, client side templating with JavaScript is more capable and ergonomic (imo).
In the 90s I created a site with XSLT that rendered to HTML. I was tempted by its promises, but in practice I found it hard to use, hard to debug, complicated and extremely verbose. I was glad when I gave it up.
XSLT is merely a glorified compression/decompression mechanism.
XSLT used as a "stylesheet" in browsers isn't dynamic, so it's like browsing static HTML pages, but expanding of on-the-wire data representation into repetitive HTML is done with XSLT's rules instead of just gzip/brotli (and it doesn't make much difference, because regular compression is really good at compressing the same things that XSLT is good at generating).
For XHTML the effect is almost identical to preprocessing the data server-side, except minor quibbles about whose CPU time is spent on it, how many bytes can be saved.
The only remaining use-case for XSLT is stopping browsers from displaying RSS like garbage, but that's using one browser feature to fix another browser regression. It'd be easier and more helpful to bring back integrated RSS readers, instead giving you very sophisticated technology for apologising how useless the RSS URL is.
No, I don't think that's the right way to characterize it - it's not compression, it's separation of concerns. The original concept for XSLT was to separate the data from the presentation - and many successful systems were built using that technology. Some rendered server-side, some rendered in the browser.
Things like XML and XSLT were useful and nice when I used them in 2004. But that's more than 20 years ago now. It's not something I encounter regularly in modern tech stacks. How widely used is this stuff in browsers at this point? I don't think browsers should be burdened with a lot of complex solutions to serve a few minority/niche use cases.
And even then, using this stuff server side was more common than relying on browsers. XHTML was still being actively pushed and Whatwg kind of made that go away in favor of HTML5. Whatwg was a breadth of fresh air in the whole captial S and lower case s semantic web debates between XML purists on one hand and people just trying to create browsers that worked on the other hand. The latter camp won by virtue of eventually producing browsers that implemented Whatwg standards and then world+dog voting with their feet and making use of those browsers and standards. The whole debate just fizzled out after that.
XSL support in browsers is part of some of the reasons WhatWG was created: a lot of poorly thought through and half specified features being proposed by and rushed through the W3C. Which was putting browser makers on the spot having to support all that in a way that worked well across browsers. The job of "lets just sit down and specify this stuff properly" is why Whatwg was created. That's a job that took many years and it created the modern web and finally enabled high levels of interoperability between browsers.
And there are other mechanisms available to developers that are well endorsed by browser makers and standards. Including using whatever libraries you want in WASM form and running them in a sandboxed environment in a browser. Which is also complex of course but at least is being widely used and well specified at this point. I don't see many compelling reasons for this stuff to live outside of that sandbox.
If the P in SPA exists to load your app, then why care? If you’ve noticed the herd thin as SSE and hypermedia trim split ends, then you may see the utility in open web tooling.
There is a fascinating alternative universe where XML standards actually took hold. I've seen it in bits and pieces. It would have been beautiful.
But that universe did not happen.
Lots of "modern" tooling works around the need. For example, in a world of Docker and Kubernetes, are those standards really that important?
I would blame the adoption of containerization for the lack of interest in XML standards, but by the time containerization happened, XML had been all but abandoned.
Maybe it was the adoption of Python, whose JSON libraries are much nicer than XML. Maybe it was the fact that so few XML specs every became mainstream.
In terms of effort, there is a huge tail in XML, where you're trying to get things working, but getting little in return for that effort. XLST is supposed to be the glue that keeps it all together, but there is no "it" to keep together.
XML also does not play very nice with streaming technologies.
I suspect that eventually XML will make a comeback. Or maybe another SGML dialect. But that time is not now.
I think the simplest explanation is that developers used it and did not like it.
The pro-XML narrative always sounded like what you wrote, as far back as I can remember: The XML people would tell you it was beautiful and perfect and better than everything as long as everyone would just do everything perfectly right at every step. Then you got into the real world and it was frustrating to deal with on every level. The realities of real-world development meant that the picture-perfect XML universe we were promised wasn't practical.
I don't understand your comparison to containerization. That feels like apples and oragnes.
HTML was conceived as a language for marking up a document that was primarily text; XML took the tags and attributes from that and tried to turn it into a data serialization and exchange format. But it was never really well suited to that, and it's obvious from looking XML-RPC or SOAP payloads that there were fundamental gaps in the ability of XML to encode type and structure information inline:
I don't think this is the only factor, but I think XML had a lot of this kind of cognitive overhead built in, and that gave it a lot of friction when stacked up against JSON and later yaml... and when it came to communicating with a SPA, it was hard to compete with JS being able to natively eval the payload responses.
The simplest explanation is that attributes were a mistake. They add another layer to the structure and create confusion as to where data is best stored within it.
XML without attributes probably would have seen wide and ready adoption.
1) Work towards a more advanced system that addresses the issues (for example, RDF/Turtle – expands XML namespaces to define classes and properties, represents graphs instead of being limited to trees unlike XML and JSON)
2) Throw it away and start from scratch. First, JSON. Then, JSON schema. Jq introduces a kind of "JSONPath". JSONL says hi to XML stream readers. JSONC because comments in config files are useful. And many more primitives that existed around XML were eventually reimplemented.
Note how the discussion around removing XSLT 1 support similarly has two ways forward: yank it out or support XSLT 3.
I lean towards Turtle replacing XML over JSON, and for XSLT 3 to replace XSLT 1 support in the browsers.
While i think a lot of xml was a bad idea, some of the issues are not instrinsically the fault of XML but some really poor design decisions by people making xml based languages.
They tended to be design by comittee messes that included every possible use case as an option.
Anyone who has ever had the misfortune of having to deal with SAML knows what i'm talking about. Its a billion line long specification, everyone only implements 10% of it, and its full of hidden gotchas that will screw up your security if you get them wrong. (Even worse, the underlying xml-signature spec is literally the worst way to do digital signatures possible. Its so bad you'd think someone was intentionally sabotaging it)
In theory this isn't xml's fault, but somehow XML seems to attract really bad spec designers.
Regarding containerization, XML wouldn’t just be a noun, but a verb (like in XSLT). You would define your remote procedures in XML.
Imagine if instead of the current Dockerfile format, we used XML, which was dynamically generated from lists of packages, and filtered and updates according to RSS feeds describing CSVs and package updates.
I’m not saying this is anything other than strange fantasy. And not a particularly nice fantasy either.
XML failed because it forced devs to spend tons of unproductive time on it
Part of the problem was it came in an era before we really understood programming, as a collective. We didn't even really know how to encapsulate objects properly, and you saw it in poor database schema designs, bizarre object inheritance patterns, poorly organised APIs, even the inconsistent method param orders in PHP. It was everywhere. Developers weren't good at laying out even POCOs.
And those bizarre designs went straight into XML, properties often in attributes, nodes that should have been attributes, over nesting, etc.
And we blamed XML for the mess where often it was just inexperience in software design as an industry that was the real cause. But XML had too much flexibility compared to the simplicity of the later JSON, meaning it helped cause the problem. JSON 'solved' the problem by being simpler.
But then the flip side was that it was too strict and starting one in code was a tedious pita where you had to specify a schema even though it didn't exist or even matter most of the time.
> I've seen it in bits and pieces. It would have been beautiful.
XHTML being based on XML tried to be a strict standard in a world where a non-strict standard existed and everybody became just very much aware on a daily that a non-strict standard is much easier to work with.
Seconded. I spend a whole lot of effort making my early 2000s websites emit compliant XHTML because it seemed like the right thing to do, and the way we were inevitably heading. And then I — and apparently almost everyone else, too, at the same time — realized it was a whole lot of busywork with almost nothing to show for it. The only thing XHTML ever added to the mix was a giant error message if you forget to write "<br/>" instead of "<br>".
Know what? Life's too short to lose time to remembering to close a self-closing tag.
About the time XHTML 1.1 came along, we collectively bailed and went to HTML5, and it was a breath of fresh air.
I think a key factor is: XML offers so many ways to serialize, you always have to decide in the individual case what the structure should be, what's an attribute, what's Text content, what's it's own attribute and those are important choices having impact on later changes.
With JSON you can dump data structures from about any language straight out and it's okay to start toying around and experimenting. Over time you might add logic for filtering out some fields, rename others, move stuff a little around without too much trouble.
Also quickly writing the structure up by hand works a lot faster in any editor, without having to repeat closing tags (while at some point closing brackets and braces will take their tribute)
However I agree: once you got the XML machinery, there is a lot of power in it.
I legitimately tried my best to like XLST on the web back in the day.
The idea behind XLST is nice — creating a stylesheet to transform raw data into presentation. The practice of using it was terrible. It was ugly, it was verbose, it was painful, it had gotchas, it made it easier for scrapers, it bound your data to your presentation more, and so on.
Most of the time I needed to generate XML to later apply a XLST style sheet, the resulting XML document was mostly a one off with no associated spec and not a serious transport document. It begged the question of why I was doing this extra work.
Making your data easy to scrape is part of the point (or just more generally work with). If you're building your web presence, you want people to easily be able to find the data on your site (unless your goal is platform lockin).
The entire point of XSLT is to separate your data from its presentation. That's why it made it easy to scrape. You could return your data in a more natural domain model and transform it via a stylesheet to its presentation.
And in doing so it is incredibly concise (mostly because XPath is so powerful).
The problem with XML is that it’s horrible to manually read and write, and it takes more effort to parse too. It’s a massive spec which contains footguns (a fair few CVEs exist just because of people using XML on publicly accessible endpoints).
Now I do think there is a need for the complexity supported by XML to exist, but 99% of the time JSON or similar is good enough while being easy to work with.
That all said, XHTML was amazing. I’d have loved to see XHTML become the standard for web markup. But alas that wasn’t to be.
I actually rather like XML(asterisk) But this is one of it's warts, It wants to be two things, A markup language, it's in the name and arguably where it should have stayed, and an object notation. This is where you start to question some of XML's fundamentals, stuff like why is it redundant? When do you stick data in attributes? Or is it better to nest tags all the way down?
Asterisk: except namespaces, I loathe those, you are skipping happily along chewing through your XML, xpathing left and right, and then find out some psychopath has decided to use namespaces, and now every thing has become super awkward and formal.
I think you're getting at a very often discussed ebb and flow between being extremely controlled vs extremely flexible. XML was astounding compared to system specific proprietary systems, and then as the need for formalism grew people wanted something simpler... And now you see the same thing growing with JSON and the need for more rigor. I personally think there are many forces to all of this, just the context at the time, prevailing senses of which things are chores and which aren't, companies trying to gain advantage, but probably most importantly is that the vast majority of people have a subset of historical information about systems and computer science, myself included, yet we have to get things done.
> I would blame the adoption of containerization for the lack of interest in XML standards, but by the time containerization happened, XML had been all but abandoned.
It got abandoned because it sucks. New technology gets adopted because it's good. XML standard were just super meh and difficult to work with. There's really not much more to it than that.
> I would blame the adoption of containerization for the lack of interest in XML standards, but by the time containerization happened, XML had been all but abandoned.
Not sure how that is true. XML is a specification for a data format, but you still need to define the schema (i.e., elements, attributes, their meaning). It's not like XML for web pages (XHTML?) could also serve as XML for Linux container descriptions or as XML for Android app manifests.
If XForms was released on browsers today, it would be hailed as a revolutionary technology. Instead, it is just one of the many things thrown away, and even now 20 years after the WHATWG took over we cannot even do a PUT request without Javascript.
>XML also does not play very nice with streaming technologies.
Not sure why just as good as JSON, if you are going to stream and parse you need a low level push or pull parser not a DOM just like JSON. See SAX for Java or XmlReader / XmlWriter in .Net.
XSLT 3 even had a streaming mode I believe which was badly needed but had constraints due to not having the whole document in memory at once.
I liked XSLT but there is no need for it, javascript is good enough if not better, many times you needed to do a xslt script tag to get some thing done it couldn't do on its own anyway, might as well use a full language with good libraries for handling XML instead. See Linq to XML etc.
Right, both sort of suck at streaming, something about being closed form tree structures would be my guess(strictly speaking, you need to close the tree to serialize it, so no clean way to append data in real time, best you can do is to leave the structure open and send fragments). Having said that, I am not really sure what a good native streaming format would look like. Best guess is something flatter, closer to CSV.
XML died because it sucks. Everyone who had to deal with it back in the day jumped to YAML and/or JSON as quickly as they could. Google didn't cause that, but because they're a search engine they followed it.
The Semantic Web was never going to win. It does not make sense on a fundamental level.
XHTML's failure had nothing to do with it, and is basically unrelated. Even if xhtml won i fail to see how that would have helped semantic web in any way shape or form.
It's a mistake to assume that the utility of a tool has anything to do with its adoption.
The real barrier to adoption for any tool are the network effects of other existing tools which create attention barriers and cultural barriers which may hinder adoption of superior alternatives.
A tool has to adhere and build on top of existing conceptual baggage in order to be appealing to the masses of developers.
This is partly because developers believe that the tools they're using now are cutting-edge and optimal... So a radical conceptual reinvention of their current favorite tools will look to them like a step backwards, regardless of how much further it can take them forward.
Related ongoing thread:
Google did not unilaterally decide to kill XSLT - https://news.ycombinator.com/item?id=44909599 - Aug 2025 (96 comments)
Oh, that would be something! All I want is to be able to make a website with some reusable elements and simple styling and keep adding content for decades, without having to think about keeping up with upgrades, dependencies and shifting framework paradigms.
I have made a couple of simple websites using PHP to bolt on reusable elements (header, footer, navigation), just because it is the solution that probably will work for ~decades without much churn. But XSLT would be even better!
The <template> element combined with the `cloneNode` works quite well for this. I've got a simple function which can take templates, clone them, fill in nodes with data from a structure, then prepare it to be added to the page.
Works a treat and makes most frameworks for the same seem completely pointless.
could you share some examples please? i am interested in trying this out.
Includes are the feature of PHP that made it catch my eye many years ago. Suddenly not having to duplicate shared headers, footers, etc and keep it all up to date across my sites was magical. I could only barely write code at all back then but mixing PHP includes into otherwise plain HTML felt natural and intuitive.
I realize JS might not be to everyone's taste, but I think I've found the absolute minimal JS solution to reuse headers and footers: https://vladimirslepnev.me/write It's almost exactly like PHP but client side, there's no "flash of content" at all.
As the article states, this is analogous to php echo. But this thread is about php include: how does it help there?
Edit: I see; you use it as a template further down. My bad for not reading through.
that's neat. i don't like inline js though. i'd like to be able to load it from a separate file so that i can reuse it on multiple pages.
i am thinking of something like
index.html
index.js
or maybe
then add a function that iterates over customnodes and makes the replacements. even better if i could just iterate over all defined functions. (there is a way, i just didn't take the time to look it up) then the functions could be:
and the iterator would wrap that function with the appropriate document.querySelector('navigation').replaceWith call.
1 reply →
PHP is a bit more fragile than it used to be. It is probably a bit for the best but I've had to fix a lot of my 2010-era PHP code to work on PHP 8.x. Though... like, it wasn't super hard. The days you could just start using a variable passed in a URL without setting a default if it wasn't...
That would really be a surprising turn of events, and what a turn it would be! Imagine if the next generation of browsers supported XSLT 3.0—entire cabinets full of blog engines, static page generators, and much more could be rewritten. I support this. XSLT is one of those technologies that is too good to disappear. On the contrary, while some JavaScript frameworks have already turned to dust, I can still rely on my XML toolchains to work in 40 years' time.
As long as you only use 1.0.
Unless 3.0 fixes the reasons why 2.0 doesn't exist in the wide world, it'll just lead to more problems.
Ancient history for me but once upon a time my company was developing a web application with C++ that used XSLT to render HTML (with our "API" exposing data via XML). It was fast even then, and gave us a great deal of flexibility. We were certainly fans of XSLT.
I read the Wikipedia on xslt, and as a long time web developer i do not understand at all how this would be useful. Plenty of people here are saying if this tech had taken hold we'd have a better world. Is there a clear example somewhere of why and how?
I think if you're of the belief that JavaScript is bad and should be avoided when possible this type of thing is seen as an alternative to that. But we've seemingly moved on to server side templating, or dynamic JavaScript apps which solve the problems that XSLT does in a more ergonomic and performant way. Compiling XML templates on the server or at build time is perfectly fine and doesn't require browser support. Doing it on the client leads to performance issues that we saw first hand with older SPA architectures, and if that isn't an issue, client side templating with JavaScript is more capable and ergonomic (imo).
In the 90s I created a site with XSLT that rendered to HTML. I was tempted by its promises, but in practice I found it hard to use, hard to debug, complicated and extremely verbose. I was glad when I gave it up.
XSLT is merely a glorified compression/decompression mechanism.
XSLT used as a "stylesheet" in browsers isn't dynamic, so it's like browsing static HTML pages, but expanding of on-the-wire data representation into repetitive HTML is done with XSLT's rules instead of just gzip/brotli (and it doesn't make much difference, because regular compression is really good at compressing the same things that XSLT is good at generating).
For XHTML the effect is almost identical to preprocessing the data server-side, except minor quibbles about whose CPU time is spent on it, how many bytes can be saved.
The only remaining use-case for XSLT is stopping browsers from displaying RSS like garbage, but that's using one browser feature to fix another browser regression. It'd be easier and more helpful to bring back integrated RSS readers, instead giving you very sophisticated technology for apologising how useless the RSS URL is.
No, I don't think that's the right way to characterize it - it's not compression, it's separation of concerns. The original concept for XSLT was to separate the data from the presentation - and many successful systems were built using that technology. Some rendered server-side, some rendered in the browser.
Things like XML and XSLT were useful and nice when I used them in 2004. But that's more than 20 years ago now. It's not something I encounter regularly in modern tech stacks. How widely used is this stuff in browsers at this point? I don't think browsers should be burdened with a lot of complex solutions to serve a few minority/niche use cases.
And even then, using this stuff server side was more common than relying on browsers. XHTML was still being actively pushed and Whatwg kind of made that go away in favor of HTML5. Whatwg was a breadth of fresh air in the whole captial S and lower case s semantic web debates between XML purists on one hand and people just trying to create browsers that worked on the other hand. The latter camp won by virtue of eventually producing browsers that implemented Whatwg standards and then world+dog voting with their feet and making use of those browsers and standards. The whole debate just fizzled out after that.
XSL support in browsers is part of some of the reasons WhatWG was created: a lot of poorly thought through and half specified features being proposed by and rushed through the W3C. Which was putting browser makers on the spot having to support all that in a way that worked well across browsers. The job of "lets just sit down and specify this stuff properly" is why Whatwg was created. That's a job that took many years and it created the modern web and finally enabled high levels of interoperability between browsers.
And there are other mechanisms available to developers that are well endorsed by browser makers and standards. Including using whatever libraries you want in WASM form and running them in a sandboxed environment in a browser. Which is also complex of course but at least is being widely used and well specified at this point. I don't see many compelling reasons for this stuff to live outside of that sandbox.
If the P in SPA exists to load your app, then why care? If you’ve noticed the herd thin as SSE and hypermedia trim split ends, then you may see the utility in open web tooling.
There is a fascinating alternative universe where XML standards actually took hold. I've seen it in bits and pieces. It would have been beautiful.
But that universe did not happen.
Lots of "modern" tooling works around the need. For example, in a world of Docker and Kubernetes, are those standards really that important?
I would blame the adoption of containerization for the lack of interest in XML standards, but by the time containerization happened, XML had been all but abandoned.
Maybe it was the adoption of Python, whose JSON libraries are much nicer than XML. Maybe it was the fact that so few XML specs every became mainstream.
In terms of effort, there is a huge tail in XML, where you're trying to get things working, but getting little in return for that effort. XLST is supposed to be the glue that keeps it all together, but there is no "it" to keep together.
XML also does not play very nice with streaming technologies.
I suspect that eventually XML will make a comeback. Or maybe another SGML dialect. But that time is not now.
I think the simplest explanation is that developers used it and did not like it.
The pro-XML narrative always sounded like what you wrote, as far back as I can remember: The XML people would tell you it was beautiful and perfect and better than everything as long as everyone would just do everything perfectly right at every step. Then you got into the real world and it was frustrating to deal with on every level. The realities of real-world development meant that the picture-perfect XML universe we were promised wasn't practical.
I don't understand your comparison to containerization. That feels like apples and oragnes.
HTML was conceived as a language for marking up a document that was primarily text; XML took the tags and attributes from that and tried to turn it into a data serialization and exchange format. But it was never really well suited to that, and it's obvious from looking XML-RPC or SOAP payloads that there were fundamental gaps in the ability of XML to encode type and structure information inline:
Compared to this, JSON had string and number types built in:
I don't think this is the only factor, but I think XML had a lot of this kind of cognitive overhead built in, and that gave it a lot of friction when stacked up against JSON and later yaml... and when it came to communicating with a SPA, it was hard to compete with JS being able to natively eval the payload responses.
2 replies →
The simplest explanation is that attributes were a mistake. They add another layer to the structure and create confusion as to where data is best stored within it.
XML without attributes probably would have seen wide and ready adoption.
2 replies →
> developers used it and did not like it.
This makes sense.
However, there are two ways to address it:
1) Work towards a more advanced system that addresses the issues (for example, RDF/Turtle – expands XML namespaces to define classes and properties, represents graphs instead of being limited to trees unlike XML and JSON)
2) Throw it away and start from scratch. First, JSON. Then, JSON schema. Jq introduces a kind of "JSONPath". JSONL says hi to XML stream readers. JSONC because comments in config files are useful. And many more primitives that existed around XML were eventually reimplemented.
Note how the discussion around removing XSLT 1 support similarly has two ways forward: yank it out or support XSLT 3.
I lean towards Turtle replacing XML over JSON, and for XSLT 3 to replace XSLT 1 support in the browsers.
2 replies →
While i think a lot of xml was a bad idea, some of the issues are not instrinsically the fault of XML but some really poor design decisions by people making xml based languages.
They tended to be design by comittee messes that included every possible use case as an option.
Anyone who has ever had the misfortune of having to deal with SAML knows what i'm talking about. Its a billion line long specification, everyone only implements 10% of it, and its full of hidden gotchas that will screw up your security if you get them wrong. (Even worse, the underlying xml-signature spec is literally the worst way to do digital signatures possible. Its so bad you'd think someone was intentionally sabotaging it)
In theory this isn't xml's fault, but somehow XML seems to attract really bad spec designers.
Regarding containerization, XML wouldn’t just be a noun, but a verb (like in XSLT). You would define your remote procedures in XML.
Imagine if instead of the current Dockerfile format, we used XML, which was dynamically generated from lists of packages, and filtered and updates according to RSS feeds describing CSVs and package updates.
I’m not saying this is anything other than strange fantasy. And not a particularly nice fantasy either.
XML failed because it forced devs to spend tons of unproductive time on it
Part of the problem was it came in an era before we really understood programming, as a collective. We didn't even really know how to encapsulate objects properly, and you saw it in poor database schema designs, bizarre object inheritance patterns, poorly organised APIs, even the inconsistent method param orders in PHP. It was everywhere. Developers weren't good at laying out even POCOs.
And those bizarre designs went straight into XML, properties often in attributes, nodes that should have been attributes, over nesting, etc.
And we blamed XML for the mess where often it was just inexperience in software design as an industry that was the real cause. But XML had too much flexibility compared to the simplicity of the later JSON, meaning it helped cause the problem. JSON 'solved' the problem by being simpler.
But then the flip side was that it was too strict and starting one in code was a tedious pita where you had to specify a schema even though it didn't exist or even matter most of the time.
5 replies →
> I've seen it in bits and pieces. It would have been beautiful.
XHTML being based on XML tried to be a strict standard in a world where a non-strict standard existed and everybody became just very much aware on a daily that a non-strict standard is much easier to work with.
I think it's very hard to compete with that.
Seconded. I spend a whole lot of effort making my early 2000s websites emit compliant XHTML because it seemed like the right thing to do, and the way we were inevitably heading. And then I — and apparently almost everyone else, too, at the same time — realized it was a whole lot of busywork with almost nothing to show for it. The only thing XHTML ever added to the mix was a giant error message if you forget to write "<br/>" instead of "<br>".
Know what? Life's too short to lose time to remembering to close a self-closing tag.
About the time XHTML 1.1 came along, we collectively bailed and went to HTML5, and it was a breath of fresh air.
3 replies →
I think a key factor is: XML offers so many ways to serialize, you always have to decide in the individual case what the structure should be, what's an attribute, what's Text content, what's it's own attribute and those are important choices having impact on later changes.
With JSON you can dump data structures from about any language straight out and it's okay to start toying around and experimenting. Over time you might add logic for filtering out some fields, rename others, move stuff a little around without too much trouble.
Also quickly writing the structure up by hand works a lot faster in any editor, without having to repeat closing tags (while at some point closing brackets and braces will take their tribute)
However I agree: once you got the XML machinery, there is a lot of power in it.
I legitimately tried my best to like XLST on the web back in the day.
The idea behind XLST is nice — creating a stylesheet to transform raw data into presentation. The practice of using it was terrible. It was ugly, it was verbose, it was painful, it had gotchas, it made it easier for scrapers, it bound your data to your presentation more, and so on.
Most of the time I needed to generate XML to later apply a XLST style sheet, the resulting XML document was mostly a one off with no associated spec and not a serious transport document. It begged the question of why I was doing this extra work.
Making your data easy to scrape is part of the point (or just more generally work with). If you're building your web presence, you want people to easily be able to find the data on your site (unless your goal is platform lockin).
The entire point of XSLT is to separate your data from its presentation. That's why it made it easy to scrape. You could return your data in a more natural domain model and transform it via a stylesheet to its presentation.
And in doing so it is incredibly concise (mostly because XPath is so powerful).
The problem with XML is that it’s horrible to manually read and write, and it takes more effort to parse too. It’s a massive spec which contains footguns (a fair few CVEs exist just because of people using XML on publicly accessible endpoints).
Now I do think there is a need for the complexity supported by XML to exist, but 99% of the time JSON or similar is good enough while being easy to work with.
That all said, XHTML was amazing. I’d have loved to see XHTML become the standard for web markup. But alas that wasn’t to be.
XHTML was too rigid - as a user agent it should try to render a document, rather than tell the user: "tough, the developer screwed up".
So XHTML lost to the much more forgiving HTML.
There was an idea to make a forgiving XML for web use cases: https://annevankesteren.nl/2007/10/xml5 but it never got traction.
1 reply →
XML was a great idea but the markup was tedious and verbose.
JSON is too simplistic.
Something built from s-expressions would probably have been ideal but we've known that for 70 years.
What would that look like?
Sometimes it gets lost that XML is a document description language like HTML.
I actually rather like XML(asterisk) But this is one of it's warts, It wants to be two things, A markup language, it's in the name and arguably where it should have stayed, and an object notation. This is where you start to question some of XML's fundamentals, stuff like why is it redundant? When do you stick data in attributes? Or is it better to nest tags all the way down?
Asterisk: except namespaces, I loathe those, you are skipping happily along chewing through your XML, xpathing left and right, and then find out some psychopath has decided to use namespaces, and now every thing has become super awkward and formal.
1 reply →
I think you're getting at a very often discussed ebb and flow between being extremely controlled vs extremely flexible. XML was astounding compared to system specific proprietary systems, and then as the need for formalism grew people wanted something simpler... And now you see the same thing growing with JSON and the need for more rigor. I personally think there are many forces to all of this, just the context at the time, prevailing senses of which things are chores and which aren't, companies trying to gain advantage, but probably most importantly is that the vast majority of people have a subset of historical information about systems and computer science, myself included, yet we have to get things done.
> I would blame the adoption of containerization for the lack of interest in XML standards, but by the time containerization happened, XML had been all but abandoned.
It got abandoned because it sucks. New technology gets adopted because it's good. XML standard were just super meh and difficult to work with. There's really not much more to it than that.
I don’t follow why docker killed XML.
> I would blame the adoption of containerization for the lack of interest in XML standards, but by the time containerization happened, XML had been all but abandoned.
Not sure how that is true. XML is a specification for a data format, but you still need to define the schema (i.e., elements, attributes, their meaning). It's not like XML for web pages (XHTML?) could also serve as XML for Linux container descriptions or as XML for Android app manifests.
If XForms was released on browsers today, it would be hailed as a revolutionary technology. Instead, it is just one of the many things thrown away, and even now 20 years after the WHATWG took over we cannot even do a PUT request without Javascript.
What a pity.
For those unaware of XForms: https://www.youtube.com/watch?v=2yYY7GJAbOo
>XML also does not play very nice with streaming technologies.
Not sure why just as good as JSON, if you are going to stream and parse you need a low level push or pull parser not a DOM just like JSON. See SAX for Java or XmlReader / XmlWriter in .Net.
XSLT 3 even had a streaming mode I believe which was badly needed but had constraints due to not having the whole document in memory at once.
I liked XSLT but there is no need for it, javascript is good enough if not better, many times you needed to do a xslt script tag to get some thing done it couldn't do on its own anyway, might as well use a full language with good libraries for handling XML instead. See Linq to XML etc.
Right, both sort of suck at streaming, something about being closed form tree structures would be my guess(strictly speaking, you need to close the tree to serialize it, so no clean way to append data in real time, best you can do is to leave the structure open and send fragments). Having said that, I am not really sure what a good native streaming format would look like. Best guess is something flatter, closer to CSV.
1 reply →
Google didn't want XML to win.
XHTML would have made the Semantic Web (capital letters) possible. Someone else could have done search better. We might have had a proper P2P web.
They wanted sloppy, because only Google scale could deal with that.
Hopefully the AI era might erode that.
XML died because it sucks. Everyone who had to deal with it back in the day jumped to YAML and/or JSON as quickly as they could. Google didn't cause that, but because they're a search engine they followed it.
The Semantic Web was never going to win. It does not make sense on a fundamental level.
XHTML's failure had nothing to do with it, and is basically unrelated. Even if xhtml won i fail to see how that would have helped semantic web in any way shape or form.
I don’t recall Google being the ones to kill XHTML. Got any references to back that claim up?
Didn't we just have the opposite conversation?
https://news.ycombinator.com/item?id=44909599
This is the positive space of that negative framing.
It's a mistake to assume that the utility of a tool has anything to do with its adoption.
The real barrier to adoption for any tool are the network effects of other existing tools which create attention barriers and cultural barriers which may hinder adoption of superior alternatives.
A tool has to adhere and build on top of existing conceptual baggage in order to be appealing to the masses of developers.
This is partly because developers believe that the tools they're using now are cutting-edge and optimal... So a radical conceptual reinvention of their current favorite tools will look to them like a step backwards, regardless of how much further it can take them forward.
[dead]
[flagged]
[flagged]
[flagged]