When viewing a page, you may see the following error message:

An error occurred: com.hannonhill.cascade.model.render.page.PageRenderException: Could not transform with Script format "path/to/format": Error on line ##: The entity name must immediately follow the '&' in the entity reference.

This usually indicates that an ampersand (&) character in a variable isn't being properly escaped in the format listed in the error message. Because & isn't a valid XML character, an error is thrown when the page is rendered.

To address this, navigate to the format specified in the error message, and escape any variables that may contain non-valid XML content such as titles or summaries. For example, if you're outputting a title variable with:

<h1>$title</h1>

Escape it using something like the $_EscapeTool:

<h1>${_EscapeTool.xml($title)}</h1>

This will ensure any invalid characters such as & are escaped as &amp; .

Did this answer your question?