O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming XML Transformations

Programming XML transformations involves creating an object instance of the Transformer class. The Transformer object will be responsible for reading the XSLT instructions, reading the XML source document, and producing the output.

The creation of the Transformer object must be done through the TransformerFactory class. The TransformerFactory class can create the Transformer object directly, using the XSLT script as a parameter, or else a Templates object can be created using the XSLT script and then the Transformer object can be created using the Templates object. The second approach has the advantage of convenience and creates a thread-safe implementation of the template class.

The code example shown below uses ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required