Using XSLT with SAX

Similar to using DOM-specific XSLT transforms, there are SAX-specific XSLT transforms available through the javax.xml.transform.sax package.

To understand how to use the XSLT transforms with SAX, create an application called MySAXTransformer.java. This is a simple application that reads an XML file and provides it as a SAX input source to create the SAXSource object.

The application will then transform this XML to display the resultant XML in the screen. Although this is a very simple example, in which the input XML file is read-out as is, it will give you an idea of how to use SAX-specific XSLT APIs.

Using SAX-Specific XSLT APIs

The following sequence of steps needs to be followed to use SAX-specific XSLT APIs:

1.
Import ...

Get Java™ APIs for XML Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.