A DOM is just a tree of nodes, each of which has a fixed set of fields based on its type. That makes it automatically doable if you throw enough collections of key-value pairs at it:
Oh ok, yes. I think I may have misunderstood the original claim then, I thought the GP was saying that JSON had mechanisms to express all xml functionality. BTH though this still only makes sense with the XML spec laying next to it and is just notation. Maybe I'm not getting the point of the discussion, I'll just let it be ;)
Yeah, there's no agreed convention on how the infoset of an XML document (which I should have used rather than DOM) ought to be represented in JSON, and generally people don't do it (e.g., RDF/JSON isn't a direct mapping from RDF/XML, but a new format to express the same basic facts), it's just technically possible.
How? (apart from a char array...)