实体已被引用但未声明 [英] Entity was referenced but not declared

查看:347
本文介绍了实体已被引用但未声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我使用tile的Spring MVC应用程序的xml文件中,我写了以下内容 -

In my xml file of Spring MVC application for using tiles, I have written the following -

<definition name="dashboard" extends="base.definition">
        <put-attribute name="title" value="Dashboard - CMS &diams; &reg; Galactic NetOne" />
        <put-attribute name="body" value="/WEB-INF/views/dashboard.jsp" />
</definition>

然而,& diams;和& reg; 给出它们被引用但未声明的错误。请帮忙。

However, &diams; and &reg; give the error that they are referenced but not declared. Please help.

推荐答案

您需要声明这些实体,或者用十六进制或十进制等效替换它们。我假设字符应该是 diams reg ;你可能需要改变它们。

You either need to declare those entities, or replace them with a hex or decimal equivalent. I'm assuming what the characters are supposed to be for diams and reg; you may need to change them.

声明实体的示例:

<!DOCTYPE definition [
<!ENTITY reg "&#174;">
<!ENTITY diams "&#9830;">
]>
<definition name="dashboard" extends="base.definition">
    <put-attribute name="title" value="Dashboard - CMS &diams; &reg; Galactic NetOne" />
    <put-attribute name="body" value="/WEB-INF/views/dashboard.jsp" />
</definition>

更换实体的示例:

<definition name="dashboard" extends="base.definition">
    <put-attribute name="title" value="Dashboard - CMS &#9830; &#174; Galactic NetOne" />
    <put-attribute name="body" value="/WEB-INF/views/dashboard.jsp" />
</definition>

您可以使用XHTML DTD作为实体的参考:http://www.w3.org/TR/xhtml1/dtds.html#h-A2

You can use the XHTML DTDs as a reference for entities: http://www.w3.org/TR/xhtml1/dtds.html#h-A2

这篇关于实体已被引用但未声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆