the compact non-xml syntax is neat: https://relaxng.org/compact-tutorial-20030326.html#id2814005
it reminds me of TypeScript.
As for XML itself, it seems like it was a huge buzzword fad in the late 90s/early 2000s, but it must not have lived up to the hype or we’d actually be using it today instead of JSON and Protobuf. I got to computer programming around when the web gave up on XHTML, so i’m not really sure what to make of the XML cultural moment. The vibe i get is of focus on precise data semantics for its own sake, very Cathedral, effort that didn’t end up delivering benefit to humans. What do you think?
XML was much better than what was there before - which was a different standard for every endpoint and often no structure at all.
XML allowed you to use tools to build automatically. We have other better tools now but back then it was like magic. Download an XSD (the more common option to Relax NG but not superior IMO), point a pre-built tool for it and it'd build strongly typed model classes and validation checkers. Then, when you called the service, chances are it would work first time. It could also be used to write the specification too. That was unheard of before. Often the spec you'd get for service was different to what the endpoint served because keeping documentation up to date was not a priority.
XML then got a little overplayed. For example, XSL transforms allowed you to turn one XML into another and because XHTML existed you have people building entire front ends in it (not recommended). You ended up in a weird hinterland where XML wasn't just for representing structured data but it had built in functionality too. It was not the right tool for that job!
I've not needed it in a long time as I prefer lighter weight formats and I don't miss it.
Just my take, others will have their own!
XML as a document markup language was neat imvho.
Like, I remember working with DocBook XML[0] and it was fine. And the idea of being able to use different namespaces in a document (think MathML and SVG in XHTML) was neat too.
The problems arose from the fact that it was adopted for everything where it largely didn't make much sense. So people came to hate it because e.g. "a functional language to transform XML into other formats" is neat, but "a functional language written in XML tags" is a terrible idea"[1].
Likewise, "define a configuration in XML" seems a good idea, but "a build system based on XML plus interpolation you're supposed to edit by hand" is not great[2].
So people threw away all of the baby XML with the bathwater, only to keep reinventing the same things over and over, e.g. SOAP+WSDL became a hodgepodge of badly documented REST APIs, swagger yaml definitions and json schemas, plus the actual ad-hoc encoding.
And I mean, it's not like SOAP+WSDL actually worked well either, it was always unreliable. And even the "mix up namespaces" idea didn't work out, cause clients never really parsed more than one thing at a time, so it was pointless (with notable small exceptions). XML-RPC[3] did work, but you still needed to have the application model somewhere else anyway.
Still, JSON has seen just as much abuse as a "serialization" format which ended up abused as configuration, schema definitions, rules language... It's the circle of life.
[1] https://developer.mozilla.org/en-US/docs/Web/XML/XSLT
>And I mean, it's not like SOAP+WSDL actually worked well either, it was always unreliable.
I don't think it ever worked. See this [0]. It's pretty crazy that people build one of the most complex and verbose data exchange formats in the world and then it turns out that duplicating the open and close tag and including the parameter name and type in the attributes bought you nothing, because implementations are treating your SOAP request as an array of strings.
I still think the reason XML failed is largely because it's a document markup language not an object serialisation language, and 99% of the time you really want the latter.
You don't need attributes, you probably don't need namespaces, you probably do want at least basic types.
Look at this for example: https://docs.rs/serde-xml-rs/0.8.2/serde_xml_rs/#caveats
JSON solves all of that for serialisation. The only problem with JSON is it has ended up being used for configuration, and then you really need at least comments. I wish JSON5 was as well supported as JSON is.
I’ve become ambivalent about relaxng, I used it a bunch because I like(d) the model, and the “Compact” syntax is really quite readable, and it’s a lot simpler than XML schemas.
However the error messages, at least when doing rng validation via libxml2, are absolutely useless, so when you have a schema error finding out why tends to be quite difficult. I also recall that trying to allow foreign schema content inside your document without validating it, but still validating your own schema, is a bit of a hassle.