Which ASCII characters are forbidden for use in SGML attributes?

StackOverflow https://stackoverflow.com/questions/8496731

  •  15-03-2021
  •  | 
  •  

سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top