4 ms·
> Elements are for data. Attributes are evil This is like, your opinion, man... ;-) You can devise your schema any way you want. Attributes are great, and they
by bambax 2y ago
> Elements are for data. Attributes are evil
This is like, your opinion, man... ;-) You can devise your schema any way you want. Attributes are great, and they exist in HTML in the form of datasets, which, as usual, are a poorly-specified and ill-designed rethinking of XML attributes
> Documents without a schema should not make your tools panic or complain
They don't. You absolutely don't need a schema. If you declare a schema, it should exist. If not, no problem?
- da_chicken 2y agoNo, the problem with attributes is that people consistently misuse them. So many things about XML break down when you make everything a self closing tag with 50 attributes. So many programmers just seem to say, "oh, it's shorter text so it must be inherently better" or "oh it's one-to-one so I should strictly avoid anything resembling a heirarchy." Like I think this guy is mostly correct in identifying bad XML: https://www.devever.net/~hl/xml https://www.devever.net/~hl/xml Though I don't necessarily agree with the "data format" framing. This idea that markup languages are not data formats seems confused. > They don't. You absolutely don't need a schema. If you declare a schema, it should exist. If not, no problem? I agree that they should not. However, I have used many tools that puke when presented with XML fragments or XML with no schema.
- deleted 2y ago[deleted]
- Mountain_Skies 2y agoSometime attribute use goes too far such as when they contain comma separated lists of items.
- bambax 2y agoSure, but that's not the fault of the format itself, is it? You can write extremely long enumerations in any natural language -- that's the author's fault.