The DTD will define the type of the ID attribute (quite probably of type ID
so as to indicate it must follow XML rules for IDs, though just because an attribute is called id
doesn't mean it's type will be ID
).
An XML editor could have the ability to add a value that followed this by generating a string that doesn't match any current ID
(e.g. elname1
, elname2
, etc.) but this would have to be a feature of the editor, not something specified by the DTD itself.
(There is comparable—"comparable" as they are not XML files though they have some similarities—functionality in many IDEs for dealing with ASP.NET, where it would add e.g. id="repeater1"
and so on. Personally I find this more of a nuisance than a boon).