Based on Scott's, Stefano's and other contributors I've revamped the Serializer interface with the following changes:
BaseSerializer has been renamed BaseMarkupSerializer, it's only intention in life is to be part of the XML/HTML/XHML serializer implementation. DOMSerializer has been added as an interface for serializing DOM, DocumentHandler is still the interface for serializing SAX. A SAX serializer need only implement DocumentHandler, but the one provided also implement the other SAX interfaces, it's the responsibility of the SAX producer to register the DocumentHandler as any other interface. I do not think it makes sense to extend HandlerBase, and not all the interfaces (SAX2) are supported by HandlerBase at the moment, but I'm looking for your input on that. The Serializer interface now serves for setting the output stream/writer/output format and for obtaining a SAX/DOM serializer. The same serializer can be reused by setting a different stream/writer/output over it's life time, there is no need to call a specific init method. SerializerFactory has been added. It uses a default SerializerFactoryImpl for registering XML/HTML/XHTML serializer factories, in addition, it reads a list of factories from a system property and register that. In order to support that, each factory now reports what method it supports (with getSupportedMethod). The default serializers for XML/HTML/XHTML are always present, but can be superceded with the properties file. (Note to Stefano and Jame: I've added a FOP method to OutputFormat, and adding a FOP serializer to the default base should be a snap. The FOP serializer does not need to extend BaseMarkupSerializer.) For backward compatibility with existing code Serializer is still an abstract class and still supports the makeSerializer/ makeSAXSerializer methods, however, I do expect these to be deprecated and Serializer to become an interface once enough people migrate. I'm looking for volunteers to test the code for a few days before it gets committed, makeing sure it works as specified and doesn't break. arkin