Is xmlns=“” a valid xml namespace?

后端 未结 2 1947
无人共我
无人共我 2020-12-18 18:29

Is \"empty\" a valid value for XML namespace? If yes what does it mean?

I have the following XML code but I\'m not sure to which namespace Field1 and

2条回答
  •  醉酒成梦
    2020-12-18 18:38

    It is not a valid XML NS. It is not a valid XML NS declaration. Please check section 2.2 of Namespaces in XML 1.0 :

    The empty string, though it is a legal URI reference, cannot be used as a namespace name.

    It is however the only way to undeclare a default NS declaration if there is one in effect, or it has no effect. See. Namespaces in XML 1.0 and 1.1, section 6.2. However the 1.1 NS rec added a way to also undeclare a NS declaration with a prefix.

    Thus it is valid, but it is not "a valid XML namespace" like the OP wrote it.

提交回复
热议问题