3 ms·
I recommend that you simply write a JSON parser and an XML parser using a parser generator. Then you will see. They are both trivial. I would be surprised if
by mikekchar 11y ago
I recommend that you simply write a JSON parser and an XML parser using a parser generator. Then you will see. They are both trivial. I would be surprised if it took you more than an afternoon to do both.
Ease of parsing was the whole point of XML. It was actually a beautiful concept that because it was a subset of SGML, you could validate documents and build smart editors, etc, etc on file formats in XML. Then when you wanted to simply read the file, the parser was mind blowingly simple to write.
Of course people decided that it would be great for communications protocols, and inter-language object representations and... all the stuff that it really wasn't great for.
And people decided that you would want to write event driven parsers and do DOM traversals and crazy things like that.
Yeah, that stuff is complicated. (and dare I offend people by saying that it wasn't really a good idea after all).
But parsing is dead easy. Personally prefer JSON for most things because it is easier to type :-)
- untitaker_ 11y agoI said "easy parsing", not "easy implementation". "Computationally cheap" is probably a better term. Everything is trivial with a parser generator. This is besides the point.