• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XMLStreamReader to InputStream

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

My webservice call returns an XMLStreamReader. I would like to know how to extract just the string representation of the whole xml so that I can dump it in the DB for future processing.

I short , converting the XMLStreamReader's content into an outputstream is what I need.

Can someone help?

Thanks in advance

Menon
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then you need an identity Transformer. When you call its transform(Source, Result) method the Source should be a StAXSource which wraps that XMLStreamReader, and the Result should be a StreamResult which wraps a StringWriter.
 
Greenhorn
Posts: 1
Android IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:Then you need an identity Transformer. When you call its transform(Source, Result) method the Source should be a StAXSource which wraps that XMLStreamReader, and the Result should be a StreamResult which wraps a StringWriter.


I think what he meant was:
 
reply
    Bookmark Topic Watch Topic
  • New Topic