Using Facelets and writing some XHTML, I cannot figure out how to create an element and then add attributes later, like in xslt if you wanted to conditionally add an attribute:
<xsl:element name="div">
<xsl:attribute name="style">color:blue;</xsl:attribute>
</xsl:element>
Google gave some examples with JSP taglib similar to
<jsp:element name="div">
<jsp:attribute name=".">...</jsp:attribute>
</jsp:element>
That library is not provided as standard in Facelets and searching the docs of the ones that are included doesn't show anything obvious.