[jsr-314-open-mirror] [jsr-314-open] [490-XmlViews] RESOLVED: Namespace and DOCTYPE

Blake Sullivan blake.sullivan at oracle.com
Thu Oct 28 16:17:29 EDT 2010


In case you guys are interested, the cases where things could get 
screwed up by accident are kind of wacky:

1) Page author is prefixing is HTML tags with an identifier
2) Page author sets the default namespace to a tag handler namespace on 
an html element

<f:view xmlns:html="http://www.w3.org/1999/xhtml" 
xmlns:f="http://java.sun.com/jsf/core" >
<html:html xmlns="http://java.sun.com/jsf/html">
<head><html:title>Title</html:title></head>
<body>
<html:h2>HTML elements ok</html:h2>
</body>
</html:html>
</f:view>

In this case, the default namespace in the output is set to 
"http://java.sun.com/jsf/html" by the default tag handler when 
processing the html tag, potentially blowing away the default namespace 
set by the ResponseWriter.

But more complicated cases like this work the way the page author might 
expect:

<f:view xmlns:h="http://www.w3.org/1999/xhtml" 
xmlns:f="http://java.sun.com/jsf/core" 
xmlns="http://java.sun.com/jsf/html">
<html>
<h:head><title>Title</title></h:head>
<h:body>
<svg xmlns="http://www.w3.org/2000/svg">
<circle ... />
</svg>
<h2>HTML elements ok</h2>
</body>
</html:html>
</f:view>

-- Blake Sullivan

On 10/28/10 12:38 PM, Blake Sullivan wrote:
> On 10/28/10 12:25 PM, Ed Burns wrote:
>> Here's what we will do for 2.1.
>>
>> SECTION: DOCTYPE
>>
>> * Add this row to Table 1-1 in Appendix A
>>
>> <process-as>xhtml<process-as>xml<process-as>JSPX
>>
>> XML Doctype   passed through       consumed         consumed
>>
>> * Add a doctype renderer to HTML_BASIC.  Yes, I know doctype is not just
>> HTML and is in fact SGML, but I can't see putting it in f: because
>> nothing there actually has a real renderer (ClientBehaviorRenderers are
>> not real Renderers).
> That's fine
>> The tag handler for this comes from Andy's suggestion.
>>
>> <h:doctype rootElement="html" public="..." system="..." />
>>
>> SECTION: Namespace
>>
>> * If you want a namespace passed through to the client, pass it on
>> <html>, as suggested by Andy.
> I think that they can set it on any element that uses the default tag 
> handler.  However, they shouldn't need to pass through the HTML 
> namespace anyway, since the XHTML ResponseWriter should be outputting 
> this for them if we are actually sending out XHTML.
>> AS>  Of course, the following approach works just fine:
>>
>>>> <f:view xmlns:f="http://java.sun.com/jsf/core"
>>>> xmlns:h="http://java.sun.com/jsf/html">
>>>> <html xmlns="http://www.w3.org/1999/xhtml">
>> SECTION: ResponseWriter
>>
>> AS>  By the time we get to the ResponseWriter, we have less information
>> AS>  available to us, and thus harder to correct arbitrary missing 
>> namespaces.
>>
>> B>  This is where the ResponseWriter is being hosed by the lack of 
>> apis for
>> B>  the namespace.  In theory, the default Facelets tag handler should
>>
>> I do not want to pull ResponseWriter into this discussion now.  That'll
>> have to wait.
> We agree that the multi-namespace cases can wait.  The XHTML 
> ResponseWriter can do the right thing anyway, so there shouldn't be 
> any basic cases where the namespace needs to be passed through.
>
> -- Blake Sullivan
>> Ed
>>
>




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