3 ms·
How are those two examples different? Every XML system I've used would see those as the same. I, however, really enjoyed this line from the link. "I once belie
by elblanco 16y ago
How are those two examples different? Every XML system I've used would see those as the same.
I, however, really enjoyed this line from the link.
"I once believed that it would be very beneficial for our long-term information needs to adorn the text with as much meta-information as possible. I still believe that the world would be far better off if it had evolved standardized syntactic notations for time, location, proper names, language, etc, and that even prose text would be
written in such a way that precision in these matters would not be sacrificed, but most people are so obsessively concerned with their immediate personal needs that anything that could be beneficial on a much larger scale have no chance of surviving."
This wonderfully, succinctly explains why efforts like the semantic web are doomed to failure.
- DrJokepu 16y agoTechnically, they are different. In the first example, there's whitespace between <a> and <b> as well </b> and </a>. Most applications ignore whitespace but they're not required to - whitespace is not ignored in XML.
- jpr 16y agoI just died a little inside. Knowing that there are people out there that would inflict this kind of nonsense as a standard for others to use makes one really lose faith in humanity.
- prodigal_erik 16y agoThat's the only way to distinguish an <strong>emphasized</strong> word from an<strong>emphasized</strong>word
- scott_s 16y agoWhich makes perfect sense for documents. So why do we use a markup language suitable for documents for general data? Whitespace matters in a document, but does not matter for data. (I'm not accusing you, I'm actually curious if you know the answer. I've never had to deal with XML.)
- bsaunder 16y agoIt may matter a lot for some data... When you send a binary file, would you like all of the zeros stripped? Your insignificant data from one perspective is possiblely significant from another perspective.
- scott_s 16y agoI don't follow. If you need literal, unstructured data embedded in a structured format, then use whatever escape mechanism the format has.
- jerf 16y agoIt is not possible to ship binary over XML. Regardless of encoding used, XML rigidly forbids the bytes corresponding to non-whitespace ASCII chars below 32: http://www.w3.org/TR/2008/REC-xml-20081126/#charsets http://www.w3.org/TR/2008/REC-xml-20081126/#charsets This makes arbitrary binary impossible. You have to base64 encode it or something. Not entirely relevant to your point, but worth bringing up. (XML doesn't ever mangle binaries, because it simply forbids them.)
- astine 16y agoBecause for the longest time there was nothing both better and standardized. I've dealt with xml many times and hate it but It's better than maintaining your own proprietary DTL.
- prodigal_erik 16y agoAnyone who adopted JSON could have been using s-expressions all along, but it's become a tradition to ignore everything Lisp got right until some brave soul gives it a makeover with curly braces.
- astine 16y agoIn theory, I'll agree with you. However, as far as I know, there are no s-exp parsing libraries for any language I know but Lisp. Also s-exps as they exist in Lisp assume some Lispish concepts that don't map to all languages. Symbols, for example, don't exist in Java. JSON is a better solution for cross language portability.
- gb 16y agoThe line breaks are classed as nodes (as is all whitepsace) unless you tell XML parsers to ignore them usually.