by dtech · 4y ago · 0 comments
The XML heyday is a little before my time, but I think attributes were considered improper design compared to only using tags by purists.
For example in the case the author supplied imagine if you wanted to add a compression type to a member. Your only choice would be an attribute which means that it can only be a string.
<struct>
<member name="faultCode"><int>-123</int></member>
<member name="faultString"><string>some fault</string></member>
</struct>
If in the original you could add a new element inside the member like <compression>
<algorithm>zstd</algorithm>
<dictionary>dict7</dictionary>
</compression>
Not the best example but the point stands. Of course the complaint is valid because while extensibility is valuable you need to weigh it against the cost of the verbosity (both in use and for developers). A <fault> struct may not contain members other than those specified.
This is true for all other structures. We believe the specification
is flexible enough so that all reasonable data-transfer needs can be
accomodated within the specified structures. If you believe strongly
that this is not true, please post a message on the discussion group.
At one point the author did intend to allow elements to contain user-defined children[0], but it seems like their position changed between that mailing list post and the spec update 7 days later.[0] https://web.archive.org/web/19991010205056/http://discuss.us...
I also think that this design was also reasonably well aligned with the internal XML capabilities of Frontier.
The opposite really, half-assed "good enough for me" is also very much visible in RSS.