thanks for replying.
However, now I need to stream the output to the client using a ServletOutputStream. I am not sure what kind of input stream I should be using. This is what I did.
After having parsed through the xml file and added additional tags..
TransfomerFactory tf = TransfomerFactory.newInstance();
Transformer t = tf.newTransformer();
Source src = new DOMSource(
doc); //Document object
// to print it out to file
Result dest = new StreamResult (new File("C:\\folder1\\temp.xml");
//to send it to console
//Result dest = new StreamResult(System.out);
t.transform(src, dest);
Then I save it to the temp file, and then use ServletOutputStream..
FileInputStream fis = new FileInputStream("C:\\folder1\\temp.xml");
ServletOutputStream out = response.getOutputStream();
byte[] buffer = new byte[64000];
int b = o
while((b = fis.read(buffer)) != -1)
out.write(buffer,0,b)
How can I get the formatted xml result to directly go to an input stream without creating a temp file?
Thanks.