RE: [xsl] Four quick questions about Xalan (in JAXP 1.1)

Subject: RE: [xsl] Four quick questions about Xalan (in JAXP 1.1)
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Tue, 7 Aug 2001 10:41:02 +0100
> 1. What version of Xalan is used in JAXP 1.1.

JAXP 1.1 is an standard API, not a specific XSLT processor. There are a
number of XSLT processors that implement the JAXP 1.1 API, including
Xalan-Java 2.
>
> 4. Can someone explain the differences between DOM/Stream/SAX
> Sources/Results....I imagine if you're only really doing one
> transformation
> (i.e not concatenating), you'd always want to use
> StreamResult....is this
> right?

Use whichever is most appropriate to the format that the source comes in, or
the format that you want the result in. If the source is serial XML in
filestore, and you want the result as serial XML in filestore, use
StreamSource / StreamResult.

>
> I understand the differences between DOM and SAX, but am not
> really sure
> what a DOM/SAXSource is, and whether the performance of SAX
> is still better
> than DOM. (I imagine XSLT involves a lot of tree traversal and node
> matching, and am wondering whether a DOMSource, with its
> tree-like Object
> Model, would be quicker for this than SAX).

If you supply a StreamSource or a SAXSource, the XSLT processor will build
its own internal tree representation, which will often be better suited to
XSLT processing than the DOM model. Only use a DOMSource if the source data
is already in the form of a DOM.

(This is general advice that I think applies to any JAXP 1.1 processor, it's
not specific to Xalan).

Mike Kay
Software AG


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread