4 ms·
Two comments: 1. You forgot namespaces. Gotta put SVG in your XHTML. 2. By the time you've done your translation, you've created json that is uglier and hard
by fizx 16y ago
Two comments:
1. You forgot namespaces. Gotta put SVG in your XHTML.
2. By the time you've done your translation, you've created json that is uglier and harder for a human to visually parse than the equivalent xml.
It turns out that json is useful when you don't want xml's features. Trying to shoehorn every one of xml's features into json creates another brand of hell.
- Groxx 16y ago1) Namespace complaints pop up every time JSON debates pop up. XML handles them two ways, and their equivalents, fully within what I already defined: ns:node => {#:"ns:node"} xmlns="http://www.w3.org/1999/xhtml" => {"xmlns":"http://www.w3.org/1999/xhtml"} ie, it's already handled. Namespaces are a parser's job for interpretation, the notation is simple. 2) The point wasn't to say JSON is better than XML - apparently you didn't read my second sentence. I said they're trivially identical - they're the same thing, with the same capabilities, but with minimally different ways of representing the same data. The point is that claiming XML can do X because it's XML and JSON can't because it's not XML is complete nonsense. All the schema / XSLT / etc tools are just that - external tools, algorithms to run against data, which have nothing to do with how the data is transmitted.
- saurik 16y agoThe key problem I have with your #2 is that it ignores what people actually mean when they say "can't". When I say I can't lift that rock over there, I don't mean that if I went and trained for a few years I wouldn't be able to do it: I mean that if I went over there right now and tried to lift it I would fail. When you realize that this is what normal people mean by "can't", suddenly concepts like "XML can do something JSON can't" make perfect sense: there exists a tool/library that makes that happen right now, and for JSON it is some theory that you have that would require sitting down and spending a bunch of time coding. (And no: those people don't "actually believe" that JSON could never be made to do those things ever: the more you interrogate them on this matter the more it will seem that way as they are going to keep saying "can't" and it is going to keep meaning something different from the way you are using it.)