DTD定义错误

时间:2010-05-10 08:32:58

标签: xml dtd

定义dtd会出错,如下所示:

<!ELEMENT line (property*)>
<!ATTLIST line showType (1|?|+|*) "1" >

错误:

The name token is required in the enumerated type list for the "showType" attribute declaration.

似乎值不能是特殊字符,例如“?”,“+”,“*”。要将字符更改为Latin-1字符,例如“&amp;#42;”(在“#”之前添加空格),请收到相同的错误。

如何解决此问题?

谢谢!

1 个答案:

答案 0 :(得分:1)

这是不可能的,因为您指定的所有枚举值必须符合XML建议书规定的Nmtokens。请参阅http://www.w3.org/TR/xml/#d0e3200

Nmtokens的BNF可以在http://www.w3.org/TR/xml/#d0e804看到。