2 ms·
Isn‘t that element vs attribute dichotomy one of the main drawbacks of XML? You don‘t have that with other formats.
by Hendrikto 4y ago
Isn‘t that element vs attribute dichotomy one of the main drawbacks of XML?
You don‘t have that with other formats.
- funcDropShadow 4y agoSomehow this is only mentioned as a drawback of XML, not of HTML --- usually.
- raverbashing 4y agoBecause in HTML it's clear what's an attribute and what's content In the case above, not so much (though I'd say it's the artifactId) But since XMLers like waddling in verbosity and bureaucracy it seems they shot their own foot with it
- EdiX 4y agoBecause HTML is a markup language. XML is also a markup language but people somehow insist on using it for things where a markup language is not appropriate (which is almost everything).
- butlerm 4y agoXML is rarely used as a markup language, in fact it is almost a failure as a markup language, witness the non-use of XHTML. It is a markup language that turned out to have more utility as a general purpose data format, and it certainly didn't get that way by people using it for applications it was not intended to support.
- HelloNurse 4y agoIt's usually forgotten that XML is intended as a markup language: text is the main content, text is contained in elements, and elements might have properties (i.e. attributes). Elements with no text children are a special case of mixed content, not the norm.
- butlerm 4y agoBy the time the XML specification was standardized from the more general SGML, I don't think there was any idea of using it only as a markup language. The XML specification lists support for a wide variety of applications as one of the design goals. Even schema validation, which long preceded XML, is something more commonly used for data not text. By this point XML is so rarely used as a markup language (by comparison with its usage as a data format) that the "Markup Language" part of the title is almost a misnomer.
- ivan_gammel 4y agoIt’s ambiguous only until you define a design convention for your schema. The rule can be as simple as using attributes only for simple non-user generated values (eg order, postal code, birth date or name is an element, uuid or timestamp is an attribute). And clients just map whatever defined in schema.