You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Prasanna Kumar AG <Pr...@virtusa.com> on 2003/02/18 07:45:46 UTC
JAXP transformer Vs. XMLSerializer in Xerces
What is the difference between using JAXP Transformer and XML serializer to
serialize an XML DOM.
Re: JAXP transformer Vs. XMLSerializer in Xerces
Posted by Joseph Kesselman <ke...@us.ibm.com>.
>What is the difference between using JAXP Transformer and XML serializer
to serialize an XML DOM.
Theoretically, or practically?
Theoretical: I believe the Transformer support is the TrAX APIs. If so, it
isn't just serializers; they're a general transformation mechanism which
can be used to read documents from XML, write them to XML, convert between
DOM and SAX or vice versa... and can also be used to run things like XSLT
stylesheets. Xalan can be invoked via TrAX, for example. The default
should be a simple copy-document-content (the "identity
transformation")... but depending on the implementation that may involve
more processing of the document; the output will be semantically correct
but may be syntactically different. A DOM serializer, on the other hand,
is more specialized, and may or may not more accurately capture
semantically-irrelevant details recorded in the DOM.
Practical: Xalan's current implementation of the Default Identity
Transformation has a few minor warts, documented in Xalan's Bugzilla
entries. Also, a dedicated DOM serializer may (or may not) be more
efficient than sending data through the more general TrAX data paths.
Also, the Xalan code may (or may not) currently do a better job of
serializing to HTML, if that's your goal.
Basically, Transformation is more powerful, but may be more costly and may
require more active involvement to get the output you want. "With power
comes responsibilty to control that power."
______________________________________
Joe Kesselman / IBM Research
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org