Transformations API for XML - IV

9 May 2008

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

Continuing with the example, we have following code for the XML document:

XMLStreamReader streamReaderXML=null;
…
//define the Source object for the XML document
Source XML=new StAXSource(streamReaderXML);

Transformation results in the following:

XMLStreamWriter streamWriter=null;
…
//define the Result object
Result XML_r=new StAXResult(streamWriter);

If you want to use Event Iterator API, the code snippet presented below willbe useful for you.

XMLEventReader eventReaderXSL=null;
//define the Source object for the stylesheet
XSL=new StAXSource(eventReaderXSL);
 
// for XML file
 
XMLEventReader eventReaderXML=null;
//define the Source object for the XML document
XML=new StAXSource(eventReaderXML);
 
// result fo transformation
 
XMLStreamWriter streamWriter=null;
//define the Result object
Result XML_r=new StAXResult(streamWriter);

Hope this helps.

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

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 - IV

Leave a Reply