Assaf Arkin wrote:
>
> I would like to introduce a printer package implementing XML/HTML/XHTML
> printing with DOM and SAX interfaces.
>
> The ability to print XML documents in these three generic formats should
> be the reponsibility of the parser package. The DOMWriter and SAXWriter
> in the samples directory do not implement sufficient functionality and
> are not packaged by default with the parser.
Keep also in mind that Xalan has its own Formatters.
I welcome your proposal because it goes toward the direction of removing
overlaps between projects.
> The following functionality is implemented currently:
>
> * XML, HTML and XHTML output methods
>
> * SAX and DOM interfaces
>
> * Factory class and reusable printer implementation
>
> * Support for controlling output format using XSLT-style OutputFormat
> object
>
> * Support for indentation format (pretty printing and line wrapping)
>
> * Support for designating elements that should print as CDATA sections
> or unescaped
>
> * Determine document type to print from either document (DOM Level 2) or
> OutputFormat
>
> * Determine output method based on document type
>
> Features not currently implemented:
>
> * Some HTML attributes should not be escaped (e.g. URLs and scripts)
>
> * Better support for various encoding formats
>
> * Media type specification not reflected in HTML <META> tag
>
> * Document type identifiers not retrieved from document (requires DOM
> Level 2)
>
> * Output method does not detect HTMLDocument (requires HTML DOM)
>
> The source files are attached under the org.apache.xerces.printer
> package. All printers are derived from BasePrinter which implements
> basic functionality, pretty printing, and a reusable printer (same
> printer can be reused with different documents, format). Printer
> implements a simple factory. OutputFormat is used to specify non-default
> format settings.
I vote +1 to the idea, but I would like to see a deeper proposal on all
the "formatting" capabilities from going to the SAX/DOM world to a
stream. Also FOP is into this.
>From a Cocoon it doesn't make a real difference, but for Xalan it will
since those classes are needed for command line operation.
Alternatives are:
1) put printers inside the parser (as Assaf proposes)
2) put printers inside the processor (as it is today)
3) put printers inside FOP
3) create a new project
What do you think?
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<[EMAIL PROTECTED]> Friedrich Nietzsche