【问题标题】:The markup declarations must be well-formed标记声明必须格式正确
【发布时间】:2015-10-27 13:17:59
【问题描述】:

我正在使用 libgdx 构建一个游戏,突然,我打开了 eclipse,它说

文档类型声明包含或指向的标记声明必须格式正确

在这个 xml 上:/Tower Conquest-core/src/TowerConquest.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
<module>
    <source path="noxer/games/ballons" />
</module>

该项目无论如何都会构建并且它可以工作,但错误仍然存​​在。我尝试删除文件并将其写回,但它一直说有错误

【问题讨论】:

    标签: java android xml gwt libgdx


    【解决方案1】:

    Eclipse 尝试使用引用的 DTD 验证 XML:

    当你打开这个 DTD 时,你会得到

    Source code for the GWT project has moved to https://gwt.googlesource.com
    
    The file you're looking for can be now found at
    https://gwt.googlesource.com/gwt/+/master/./distro-source/core/src/gwt-module.dtd
    (if it's not been deleted or renamed since then.)
    

    显然这不是有效的 DTD,因此 Eclipse 会给出错误。

    解决方案似乎很简单:在您的 XML 中为 DTD 使用新的 URL

    <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "https://gwt.googlesource.com/gwt/+/master/distro-source/core/src/gwt-module.dtd">
    

    不幸的是,这个 URL 返回了存储库文件的 HTML 表示,Eclipse 将再次抱怨。 还有

    https://gwt.googlesource.com/gwt/+/master/distro-source/core/src/gwt-module.dtd?format=TEXT 
    

    似乎无法正常工作。

    然后,您可以创建 DTD 的本地版本并相应地更改 XML 中的 doctype 声明,或者如果验证不是必需的,则简单地删除 doctype 声明。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多