3 ms·
> Why is the country name an attribute but not the rank? Perhaps because it's an example of what is possible in XML and how to parse it, and not, in fact, a pa
by dofm 4mo ago
> Why is the country name an attribute but not the rank?
Perhaps because it's an example of what is possible in XML and how to parse it, and not, in fact, a particularly good or canonical example of XML?
- woodruffw 4mo agoI think GP’s question was rhetorical. They know it’s an example.
- inigyou 4mo agoIt's a very typical example. The real world does look like this.
- dofm 4mo agoSo it was, in fact, designed correctly as an illustration. Either way the context of that comment is "why does XML do this?" when in fact XML, itself, does not. It allows both data and metadata; this is not a flaw, because it is not a pure data format. You can choose to use those features correctly or incorrectly, and how you choose to do it is application-specific, because it is a format that is capable of producing both structured and semi-structured markup. Sometimes an ID is data; sometimes in the context of an application it is only metadata. It depends. And that is putting aside that this complaint was used to mount a partial defence of YAML, which is one of the worst things the open source community has ever done to the world. YAML is never the answer.