4 ms·
If you're not using the full XML ecosystem then yes, it can be overly verbose for just a simple document, especially if the person who defined the format went a
by spiralx 6y ago
If you're not using the full XML ecosystem then yes, it can be overly verbose for just a simple document, especially if the person who defined the format went all in on "XML-ising" it - the worst and most common offender being using elements to define lists of key-value pairs (especially if both have an element wrapped in another element!) instead of using attributes, followed by not specifying a default namespace so everything has "xml:" in front of it making it hard to work out what the hell the thing actually is as well as pointlessly inflating the file size.
When you're dealing with large amounts of structured data of different kinds that you want to combine in many different ways there's not really anything that comes close to the combination of XML, XPath, schemas, XSLT and XQuery. But if you're not something like the huge medical publisher I worked for then you definitely don't need all that.
- TeMPOraL 6y agoI agree. I didn't mention this in my original comment, but the follow-up to the story is: the industry eventually moved on to leaner formats like JSON, but in the process, threw away all that made XML very useful over the years - like schemas, for example. Arguably, this is a step back.
- spiralx 6y agoI do maintain a couple of JSON schemas and they're a bit clunky due to the JSON syntax (although they're nicer in YAML which my validator can use) but the newer versions of the spec do allow you do specify complex enough rules to cover most cases. But an equivalent to XSLT doesn't make a huge amount of sense for JSON. I've got an XSLT stylesheet I wrote you can add to an HTML page via the xml-stylesheet directive that turns it into a pretty-printed display of its own markup, complete with syntax highlighting. Pointless but neat that it's possible :)