Jim Driscoll wrote:
On 4/7/09 2:10 PM, Alexandr Smirnov wrote:
> Great! JSF is gradually going to get full XML support. I've offered
> sometimes to switch into standard SAX handler instead of proprietary
> writer, because Java has a wide range of tools for XML processing. It
> would be better to move ResponseWriter into SAX ContentHandler and
> complimentary interfaces, or at least define all necessary methods to
> use simple wrapper for XML based libraries.
Something easily pluggable would probably be nice for 2.1 (though I'd
imagine that the ResponseWriterWrapper could be used for that task
now, if you had a mind to do it).
The CDATA code was added simply because there was no other way to
coordinate between the impl and the api that didn't involve convoluted
code, but it's easy to imagine a need for more full support - in which
case, being able to plug something in cleanly would serve that need
best (though for many applications, the simple interface of
ResponseWriter will probably continue to be sufficient, so I would
argue against deprecating it).
The ResponseWriter is simple to write small
renderers by hand, but it is
going to be painful in the complex cases. The standard JAXP interfaces
are needed for integration purposes, like rendering SVG graphics from
Batik, RDFa from Jena or Sesame, office XML documents and even render
components as JAXB-annotated beans. The ongoing HTML5 standard is also
much more XML-like.
Jim