Entity was referenced but not declared

jakarta-ee, xml

Solution

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

Problem

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.

Original source