News for hackers. Stuff that matters.
Re:ActivityPub could be the future by PurpleRamen on Friday July 27, 2018 @11:27AM (#17626654)
> how can you do namespaces in JSON for example?

For what is this neccessary?

Re:ActivityPub could be the future by gmueckl on Friday July 27, 2018 @12:14PM (#17627029)
Nsmespaces allow XML file formats flexible and extensible in interesting ways: each namespace is tied to an independent schema, allowing for a very natural nesting of validatable XML in arbitrary formats. The namespaces avoid name collision between XML tags from different schemas. The grandparent gave a good example of this kind of nesting.

JSON is incapable of the same kind of nesting because there are no explicit namespace to identify nested data formats and to avoid name collisions.

Re:ActivityPub could be the future by ekidd on Friday July 27, 2018 @12:23PM (#17627104)
XML namespaces do offer some nice possibilities. But the lack of official JSON namespaces doesn't prevent you from doing something like:

    {
        "built_in": "value",
        "org.example.my_extension": "value"
    }
If you want to validate it, you might need to jump through some JSON schema hoops, of course.
Re:ActivityPub could be the future by lolsal on Friday July 27, 2018 @01:30PM (#17627609)
It seems that would make JSON likely more verbose than XML.
Re:ActivityPub could be the future by PurpleRamen on Friday July 27, 2018 @12:24PM (#17627121)
Yes, it's a nice option for some settings. But why is it neccessary in this context? Where there is a defined data-exchange format which would not have name collisions happen?
Re:ActivityPub could be the future by gmueckl on Friday July 27, 2018 @06:48PM (#17630087)
XMPP as an extensible protocol (it's even in the name!) relies on XML namespaces to avoid collisions between extensions. Were it to use something like JSON, extensions would all have to be aware of each other so that no naming collisions or other awkward behaviour can occur.