3 ms·
No, xml is inherently different. It’s a mark up language unlike the others which are data languages. In xml you can nest data inside of data. In json you can
by wodenokoto 3y ago
No, xml is inherently different.
It’s a mark up language unlike the others which are data languages.
In xml you can nest data inside of data. In json you can have data structures that can hold data.
Eg., `<tag>lorem <tag2>ipsum</tag2>.</tag>` is not a thing in the others.
- simpaticoder 3y agoYour example shows taking a subset of a text node and wrapping in a tag. How many XML languages use this quality? The only ones I've ever worked with go to great lengths to not mix text nodes with other children nodes. And it's easy to see why such usage is considered poor practice: if you're making a language, you generally want more structure, not less. I'm not familiar with the distinction between 'markup languages' and 'data languages'. Ignoring the text/structured mixing issue, which I think is vestigial in XML and unused in DSLs, these are all isomorphic to each other and can nest data inside of data in a similar way: <person> <name>John Doe</name> <age>30</age> <city>New York</city> <employment> <position>Software Engineer</position> <company>ABC Tech</company> <years>5</years> </employment> </person> { "person": { "name": "John Doe", "age": 30, "city": "New York", "employment": { "position": "Software Engineer", "company": "ABC Tech", "years": 5 } } } person: name: John Doe age: 30 city: New York employment: position: Software Engineer company: ABC Tech years: 5