|
|
|
|
|
by DaiPlusPlus
3232 days ago
|
|
I don't mean the current verbose JSON standard (e.g. string keys, no comments) but something derived from it - because XML's capabilities are a subset of what JS/JSON is capable of, and because the same syntax for complex properties can be used for trivial properties it simplifies the syntax, for example: <Foo Trivial="trivial">
<Foo.Complex>
<Bar Bound="{Binding qux}" />
</Foo.Complex>
</Foo> Could be represented in strict JSON as: {
"Type": "Foo",
"Trivial": "trivial",
"Complex": {
"Type": "Bar",
"Bound": {
"Type": "Binding",
"Path": "qux"
}
}
} A more succint JSON-derivative would allow for the "Type" property to be specified anonymously, object keys as identifiers, not strings, allow comments, and use object constructors directly instead of object literals: { Foo,
Trivial: "trivial",
Complex: { Bar, Bound: new Binding( "qux" ) } } |
|
It is the other way around, JSON is a subset of XML features.
XML is a very expressive language/file format.