News for hackers. Stuff that matters.
Re:Deprecating XML by rbetts on Wednesday November 17, 2010 @08:57PM (#1916532)
An XML document is mixed content in the sense that it can be validated, signed, partially encrypted (perhaps by multiple actors), can be wrapped by a header, and augmented for application level routing. [edit: where each of these actions may mix-in content with the original document.] And all of this can be done in a standards compliant way.

Now the standards can totally suck - they can be improperly implemented - and they can be difficult to make performant... But those are largely issues of implementation unrelated to the core XML and XML namespace specifications.

It seems unlikely to me that JSON could reasonably be purposed to those use cases...

Re:Deprecating XML by Udo on Wednesday November 17, 2010 @10:59PM (#1916797)
> It seems unlikely to me that JSON could reasonably be purposed to those use cases...

Since any XML document can in theory be converted into a complete JSON representation I do believe that nothing is keeping people from doing exactly those use cases. You're right in asserting that this isn't happening in practice with JSON. I allege the reason for this is that XML isn't really used for these kinds of operations either. Sure, the XML working group put out a stunning amount of "standards" that prescribe these conventions, but in practice NONE of it actually works across vendors without heavy intervention and some pretty shocking compromises in application code. Most complex XML products are not actually that interoperable, they mostly just work because one or more communication endpoints are basically faking compliance of their interfaces.

Re:Deprecating XML by roel_v on Thursday November 18, 2010 @02:42AM (#1917185)
"Since any XML document can in theory be converted into a complete JSON representation"

How? (apart from a char array...)

Re:Deprecating XML by prodigal_erik on Thursday November 18, 2010 @03:08AM (#1917216)
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:

  # <a href="http://example.com">hello world</a>

  {
    "node-type":"element",
    "namespace":"http://www.w3.org/1999/xhtml",
    "name":"a",
    "attributes":[
      {
        "namespace":null,
        "name":"href",
        "value":"http://example.com"
      }
    ],
    "children":[
      {
        "node-type":"text",
        "value":"hello world"
      }
    ]
  }
Re:Deprecating XML by roel_v on Thursday November 18, 2010 @04:02AM (#1917273)
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 ;)
Re:Deprecating XML by prodigal_erik on Saturday November 20, 2010 @06:01PM (#1925632)
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.