HY!
我的代码:
<!DOCTYPE email [
<!ELEMENT email (von,zu,titel,text,prior)>
<!ELEMENT von (#PCDATA)>
<!ELEMENT zu (#PCDATA)>
<!ELEMENT titel (#PCDATA)>
<!ELEMENT text (#PCDATA)>
<!ATTLIST prior type (#PCDATA) #REQUIRED >
]>
<email>
<von>test@test.com</von>
<zu>xxx@xxx.com</zu>
<titel>Hello</titel>
<text>Dear John....;-).</text>
<prior type="schnell"/>
</email>
错误:
The name token is required in the enumerated type list for the "type" attribute declaration.
请帮忙!
答案 0 :(得分:0)
<!ATTLIST prior type CDATA #REQUIRED>
有关属性类型,请参阅http://www.w3.org/TR/REC-xml/#NT-AttType,其中没有PCDATA。此外,不需要括号和#
答案 1 :(得分:0)
<!ELEMENT prior EMPTY>
<!ATTLIST prior type NMTOKEN #REQUIRED>
您不仅需要修改prior
的ATTLIST声明,还需要添加prior
的元素声明。我为CDATA
属性使用了type
以外的类型,这样您就可以看到不同的内容。