Thanks Blake for explaining it so well. That's exactly right.
A user could actually nominate
as the
namespace without a prefix and prefix the html tags--don't know if
that's attractive to anyone.
As for the comments, it is surprising to users that they can't comment
out parts of pages during debugging--they still get interpreted by
facelets. You and I know that they can use
javax.faces.FACELETS_SKIP_COMMENTS or ui:remove, but still, an XML
author does not expect to have to do such a thing.
On Tue, Oct 26, 2010 at 1:55 AM, Blake Sullivan
<blake.sullivan(a)oracle.com> wrote:
Ed,
I read this the same way as you did originally, but Cay actually wrote
CH> 2) To not surprise developers with nonstandard XML processing (such as
CH> processing comments).
[Emphasis mine]
So I think that Cay is either talking about the general issue of comments
being passed through, especially since he has his <!-- Comments consumed -->
example.
I also suspect that instead of saying "*all* elements prefixed", he really
means that all generated DOM elements have a valid namespace either through
prefixing or through the page author specifying default namespaces:
<?xml version="1.0" encoding="UTF-8"?>
<weNeedSomeRootElement
xmlns= "http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
>
<h:html>
<h:head><h:title>Raw XML View</h:title></h:head>
<h:body>
<h2>XML declaration: consumed<h2>
<h2>Processing instruction: consumed<h2>
<?xml-stylesheet href="funky.xsl" type="text/xml"
alternate="yes"?>
<h2>CDATA section: consumed<h2>
<![CDATA[ <p>This is CDATA</p> ]]>
<h2>Comments: consumed<h2>
<!-- comments consumed -->
<h:form prependId="false" id="form">
<h:panelGrid id="grid" column="2">
<h:outputText id="text" value="hello" />
<h:commandButton id="button" value="reload"
/>
</h:panelGrid>
<p>html template text</p>
</h:form>
</h:body>
</h:html>
</weNeedSomeRootElement>
One of the other aspects shown in Cay's example is that the xml-stylesheet
processing instruction would be consumed by the Facelets engine, NOT the
browser.
-- Blake Sullivan
On 10/22/10 8:02 AM, Ed Burns wrote:
On Fri, 22 Oct 2010 09:23:33 +0700, Cay Horstmann <cay.horstmann(a)gmail.com>
said:
CH> As I had understood it, the need for XML was motivated by these
usecases:
CH> 1) To allow developers to use standard XML processing tools. In
CH> particular, this requires to be truthful about the nature of the
CH> documents (i.e. not claim that something is an XHTML file when it
CH> isn't, but is really an artifact that will eventually be transformed
CH> into XHTML)
...and the most important manifestation of that, in my opinion, is the
requirement to have *all* elements prefixed. For example, a proper JSF
XML Syntax View would look like this.
<?xml version="1.0" encoding="UTF-8"?>
<weNeedSomeRootElement
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:html>
<h:head><h:title>Raw XML View</h:title></h:head>
<h:body>
<html:h2>XML declaration: consumed</html:h2>
<html:h2>Processing instruction: consumed</html:h2>
<?xml-stylesheet href="funky.xsl" type="text/xml"
alternate="yes"?>
<html:h2>CDATA section: consumed</html:h2>
<![CDATA[ <p>This is CDATA</p> ]]>
<html:h2>Comments: consumed</html:h2>
<!-- comments consumed -->
<h:form prependId="false" id="form">
<h:panelGrid id="grid" column="2">
<h:outputText id="text" value="hello" />
<h:commandButton id="button" value="reload"
/>
</h:panelGrid>
<html:p>html template text</html:p>
</h:form>
</h:body>
</h:html>
</weNeedSomeRootElement>
CH> 2) To not surprise developers with nonstandard XML processing (such as
CH> processing comments).
I'm not sure what you mean here. XML processing instructions are
standard in XML.