Is an xml attribute without a value, valid?

前端 未结 3 539
执念已碎
执念已碎 2020-11-30 10:47

I want to have an XML attribute without any value, which simply has one meaning when it exists or does not exist.

Is that valid?

3条回答
  •  孤城傲影
    2020-11-30 11:15

    No.

    Boolean attributes in XML are of the form foo="foo".

    Even in SGML, you must provide the value, (it is the name, = and quotes that you can omit, which is why you have things like

    提交评论

提交回复
热议问题