问题
Apart from whitespace, quotation mark, equal sign, and tab, which other characters of the printable subset of ASCII are forbidden to be used as attribute names in SGML?
回答1:
By default, SGML allows only alphanumeric values for SGML names. What additional characters are allowed for SGML names is controlled by the SGML declaration; specifically UCNMCHAR
and LCNMCHAR
under NAMING
.
For example, if you look at the SGML declaration for HTML 4, you'll see:
LCNMCHAR ".-_:"
UCNMCHAR ".-_:"
This means that the characters .
, -
, _
, and :
are also allowed in SGML names (element/attribute/entity/etc).
NOTE: Only a letter is allowed as the first character of an SGML name.
来源:https://stackoverflow.com/questions/8496731/which-ascii-characters-are-forbidden-for-use-in-sgml-attributes