Load the TransformerFactory
with the static TransformerFactory.newInstance()
factory method.
Form a Source
object from the XSLT stylesheet.
Pass this Source
object
to the factory’s newTransformer()
factory method to build a Transformer
object.
Build a Source
object
from the input XML document you wish to transform.
Build a Result
object
for the target of the transformation.
Pass both the source and the result to
the Transformer
object’s transform()
method.
Steps four through six can be repeated for as many different
input documents as you want. You can reuse the same
Transformer
object repeatedly in
series, though you can’t use it in multiple threads in
parallel.