Multiple Enumerated Attributes With The Same Value

What this "for interoperability" is saying is not obvious, and to understand why it's here requires a little bit of backtracking. SGML was designed with immense concern for saving keystrokes and disk space. For this reason, it has a lot of "minimization" features, allowing you to leave out pieces of markup. One of the things you can minimize away is the attribute name; so suppose you had a declaration like this:

<!ATTLIST List Ordered (yes|no) #REQUIRED>

Then, using minimization, I could do the following: <List no>; there's no reason to put in the Ordered=, you see, because it's "obvious." That's OK, until I expand that attribute list a little bit:

 Ordered (yes|no) "yes"
 Secret (yes|no) "no">

Then, what does <List no> mean? To get around this problem, SGML made that declaration illegal; you couldn't have two of these enumerated attributes that shared a common value. Since XML doesn't have minimization, it just isn't a problem. And since most users of SGML don't do minimization, it hadn't been a problem there either; but the inability to have declarations like this certainly had been.

So as with other such problems in XML, we worked with the SGML committee and got agreement to relax this restriction in SGML, allowing us to bypass it in XML. But remember, as with all the other "for interoperability" rules, there is a large installed base of SGML tools that are not forgiving on this point.

Back-link to spec

Copyright © 1998, Tim Bray. All rights reserved.