What does the message "The entity name must immediately foll

What does the message "The entity name must immediately foll

Postby haretu » Fri Jun 08, 2012 1:03 pm

What does the message "The entity name must immediately follow the '&' in the entity reference." mean?
You're editing a scripted page and get this message when saving:

The entity name must immediately follow the '&' in the entity reference.

This message is complaining about an unescaped & character somewhere in your code. This can happen if you use the && operator in an attribute script, as in this example:

<div editme="if user.isLoggedIn && page.isScript"> ... </div>

For the scripted page to be valid XML, the && must be escaped like this:

<div editme="if user.isLoggedIn &amp;&amp; page.isScript"> ... </div>

You can use && in code within a <script type="text/vnd.editme.js">...</script> tag, but only if you place the code within a CDATA node, which is always recommended. Here is a properly formatted server-side script tag:

<script type="text/vnd.editme.js"><![CDATA[
// code goes here
]]></script>
haretu
 
Posts: 132
Joined: Sat Jan 08, 2011 9:56 pm

Return to Primefaces

Who is online

Users browsing this forum: No registered users and 0 guests

cron