[jsr-314-open-mirror] [jsr-314-open] [490-XmlViews] Namespace handling [Was: Chapter 11: The JSF XML View Syntax]

Andy Schwartz andy.schwartz at oracle.com
Thu Oct 28 12:57:31 EDT 2010


On 10/28/10 12:08 PM, Blake Sullivan wrote:
> I was thinking that this was an XHTML ResponseWriter thing.  It's not 
> like the ResponseWriter doesn't know that nobody has output a prefix 
> mapping for XHTML yet (ignoring the case where it was sent out through 
> unescaped text and even then creating a new mapping isn't the end of 
> the world as long as it doesn't conflict).

Right.  I think this would work well for simple use cases - such as 
ensuring that the root <html> element ends up with the proper xhtml 
namespace.

Should we consider more complex use cases, eg:

> <f:view xmlns:f="http://java.sun.com/jsf/core"
>         xmlns:h="http://java.sun.com/jsf/html"
>         xmlns="http://www.w3.org/1999/xhtml">
>   <html>
>     <h:head></h:head>
>     <h:body xmlns="http://www.w3.org/2000/svg">
>       <svg version="1.1" ...>
>         <circle .../>
>       </svg>
>     </h:body>
>     </h:head>
>   </html>
> </f:view>

In this case, the Facelets compiler has some chance of figuring out that 
the SVG namespace needs to be pushed down to the <svg> element.  By the 
time we get to the ResponseWriter, we have less information available to 
us, and thus harder to correct arbitrary missing namespaces.

I don't know how much we care about solving this more generic case.  The 
xhtml namespace issue is clearly more pressing.

> We will eventually have a bigger problem that the ResponseWriter 
> interface allows no way to specify a namespace.  This is lame and I'm 
> not a big fan of the workaround of abusing the default namespace or 
> passing the prefixes in with the element names.

Agreed.

Andy

>
> -- Blake Sullivan
>




More information about the jsr-314-open-mirror mailing list