Is an xml attribute without a value, valid?

前端 未结 3 534
执念已碎
执念已碎 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:20

    Yes. You can have an attribute whose only permitted value is the empty string, "". I'm not sure it's good design, though; I would normally suggest a boolean attribute with values true/false, and a default value of false.

提交回复
热议问题