Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity was referenced but not declared

Tags:

xml

jakarta-ee

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>

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

like image 975
ultimate.divinity Avatar asked Apr 07 '13 04:04

ultimate.divinity


1 Answers

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.

Example of declaring the entities:

<!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>

Example of replacing the entities:

<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>

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

like image 123
Daniel Haley Avatar answered Oct 13 '22 12:10

Daniel Haley