Hacker News new | ask | show | jobs
by simonw 3171 days ago
When you’re designing an XML schema, answering the question “should this be an attribute or a nested elember” is awkward because there is rarely an obvious correct answer.

With JSON, the answer is always a name/value pair.

1 comments

That's a problem with XML Schema, not XML.

A schema language in which subordinate values being presented as attributes vs. elements was a presentational option in the concrete XML representation rather than a dictate of the schema language would solve this simply. There are already multiple schema languages for XML; needing a better schema language doesn't begin to provide a reason for a different representation language, since schema and representation language are separate concerns.