问题
In a dtd, can an element be defined as
<!ELEMENT name (ANY|EMPTY)>
meaning that an name can either be like <name/>
or it can contain any elements that does break xml rules?
回答1:
No, but if you use the type ANY
, it can still be empty.
Examples:
<!DOCTYPE name [
<!ELEMENT name ANY>
]>
<name/>
-
<!DOCTYPE name [
<!ELEMENT name ANY>
<!ELEMENT foo (#PCDATA)>
]>
<name>
<foo/>
</name>
来源:https://stackoverflow.com/questions/12736648/dtd-element-empty-and-any