代码之家  ›  专栏  ›  技术社区  ›  Geln Yang

DTD定义错误

  •  1
  • Geln Yang  · 技术社区  · 14 年前

    将DTD定义为以下内容将出错:

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

    错误:

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

    似乎值不能是特殊字符,例如“?”,“+”,“*”。若要将字符更改为拉丁文-1字符,如“&42;”(在“”之前添加一个空白),请获得相同的错误。

    如何解决这个问题?

    谢谢!

    1 回复  |  直到 13 年前
        1
  •  1
  •   alexbrn    13 年前

    这是不可能的,因为您指定的所有枚举值必须与XML建议指定的NMTokens一致。见 http://www.w3.org/TR/xml/#d0e3200 .

    nmtokens的bnf可以在 http://www.w3.org/TR/xml/#d0e804 .