Problems with & handling between RI and Facelets

From: Michael Youngstrom <>
Date: Fri, 28 Jul 2006 11:23:13 -0600

I'm sending this to both the RI and facelets list because I'm not sure
who's problem it is. The following code does not work when using
JSF-RI 1.2 and Facelets.

<h:outputLink value="">
     <f:param name="param1" value="20"/>
     <f:param name="param2" value="30"/>
     Some Link

When that code is placed in Facelets I get an XML Parsing Error. The
Facelets xml parser is not handling the & that is written from the
h:outputLink. If I hardcode the anchor into my page like this:

<a href="">

I get the same error. If I change the & to an entity reference &amp;
then everything works fine. If I create a plain .html page with a
link using the entity reference &amp; then the link appears to work
fine. So I figured that perhaps the RI should be writing an &amp;
when rendering the outputLink instead of an &. However, doing a
search on the RI list found this bug which
is addressing the same issue but for a graphicImage and directs the
graphicImage to output an & instead of an &amp;. So the question is
should the RI be outputing &amp; or &. Or should facelets be
processing the JSF generated xhtml differently?

Incidentally the xml spec says that the & in an attribute should be
escaped as an entity reference:

So how do we fix this?