Well formed XML? XML references within tag names and attribute names

后端 未结 3 732
没有蜡笔的小新
没有蜡笔的小新 2021-01-19 08:24

I have been searching trying to confirm my reading of the XML spec. My interpretation is that pre-defined entities and numeric character references are not allowed in tag n

3条回答
  •  北海茫月
    2021-01-19 09:02

    This is very simple: no entities can be used within names. Both "parsers" are wrong here. XML specification quite clearly defines this -- there are no hidden default rules; if some construct is not included, it is not allowed.

    Entities can only be used within regular character content and attribute values. And they can be included in some other places (comments, processing instructions, DTD subsets) but won't be expanded (i.e. are not recognized as entities).

提交回复
热议问题