Incidentally, is there any significant performance difference between the two methods? I'm hoping "no", i.e., we can use internally whichever proves more convenient.
Glen --- Jeremias Maerki <[EMAIL PROTECTED]> wrote: > Because, IMO, it allows the user to use the same > pattern for virtually > everything: > 1. Create a TransformerFactory > 2. Create a Transformer and optionally use a > stylesheet > 3. Specify the Source (DOM, stream, file, SAX....) > 4. Specify the Result (DOM, stream, file, SAX....) > 5. Start the transformation. > > I use the JAXP part for XML parsing almost never > because I can do most > with this pattern. During my work I realized that > most people don't even > know about this pattern. They save the FO as a file > or as a DOM and then > send it to FOP. Very inefficient. Using the "one API > approach" we can > teach our users a few handy things with which they > can do whatever they > need: > - Serializing a DOM to a file > - Transforming an XML file to HTML > - Creating a PDF from a Java object > - you name it. > > Of course, in some situation you will need to learn > a few additional > things like using the TransformerHandler for > pipelining multiple XSL > transformations. But most of the things can be done > using the > Transformer. >