  From Eclipsepedia  Jump to: navigation, search    JET launch
configurations run a JET 'transformation' (which executes a
bunch of templates, and persists the template results in the
workspace). But, how do I execute individual JET templates from
a Java, and consume the template results from a Java program?
A number of mechanisms are possible, depending on your
requirements, but they all require you to do the following three
steps:    1. create a JET2Context object to encapsulate your
input and track execution errors   2. create a JET2Writer
instance to record your template results   3. load and execute
the template  Creating a JET2Context object  JET2Context objects
are normally constructed as part of launching a JET
transformation. Unfortunately, constructing one for direct
template execution is a little tricky. The following static
method does all the 'right' things.   * Create a JET context
suitable individual template execution  * @param modelRoot the
model root (corresponds to XPath /). May be <code>