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

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

问题描述

在我用于使用磁贴的 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.

推荐答案

您要么需要声明这些实体,要么用等效的十六进制或十进制替换它们.我假设 diamsreg 的字符应该是什么;您可能需要更改它们.

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天全站免登陆