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