Transformations API for XML - II

8 May 2008

Do read the first postr on this topic before going through this one.

Second step is to provide a javax.xml.transform.Source object for the XSL stylesheet. For this, you have to instantiate the proper XXXSource class.

Now is the time to obtain a javax.xml.transform.Transformer object. This is done by calling the newTransformer method. This object will transform the source-tree into result-tree.

public abstract Transformer newTransformer(Source source) throws
TransformerConfigurationException

The newTransformer method expects the source of the XSL stylesheet as parameter.

We also have to indicate the XML document for transformation. This is done by creating another Source object. For this one has to instantiate the proper XXXSource class.

Now is the time to create a javax.xml.transform.Result object. Also we have to decide what kind of result we will use and then we havet o instantiate the proper XXXResult class.

To start the transformationm Transformer.transform method is called. This method retrieves the Source of the XML document (that we wish to transform) and the Result of that transformation:

public abstract void transform(Source XMLs, Result result)throws 
TransformerException

continued …

del.icio.us:Transformations API for XML - II  digg:Transformations API for XML - II  spurl:Transformations API for XML - II  wists:Transformations API for XML - II  simpy:Transformations API for XML - II  newsvine:Transformations API for XML - II  blinklist:Transformations API for XML - II  furl:Transformations API for XML - II  reddit:Transformations API for XML - II  fark:Transformations API for XML - II  blogmarks:Transformations API for XML - II  Y!:Transformations API for XML - II  smarking:Transformations API for XML - II  magnolia:Transformations API for XML - II  segnalo:Transformations API for XML - II  gifttagging:Transformations API for XML - II

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Transformations API for XML - II

Leave a Reply