P
Petterson Mikael
Hi,
Is there a way to avoid creating a file and just keep the stream in
memory and send the stream to the transform method.
The transform() in java supports a lot of streams and I don't really see
the purpose of creating a temporary file and send the file name as
source.
All advice is greatly appreciated in this matter.
//Mikael
Here is my code:
***********************************************
public void findTitle( .....){
//if title is found then set titleFound == true
try{
OutputStream fout= new FileOutputStream("result.xml");
OutputStream bout= new BufferedOutputStream(fout);
OutputStreamWriter out = new OutputStreamWriter(bout, "8859_1");
if (titleFound == true){
//Build and write xml document.
out.write( (<?xml version=\"1.0\" "));
out.write(...);
....
out.flush();
out.close();
}
}catch(IOException ioe){
System.out.println(e.getMessage());s
}
}
In my JSP page:
//I will check if there is a file called result.xml. If it is I will
call transfrom()
transform (String pathToXml, String pathToXsl, JspWriter out){
}
Is there a way to avoid creating a file and just keep the stream in
memory and send the stream to the transform method.
The transform() in java supports a lot of streams and I don't really see
the purpose of creating a temporary file and send the file name as
source.
All advice is greatly appreciated in this matter.
//Mikael
Here is my code:
***********************************************
public void findTitle( .....){
//if title is found then set titleFound == true
try{
OutputStream fout= new FileOutputStream("result.xml");
OutputStream bout= new BufferedOutputStream(fout);
OutputStreamWriter out = new OutputStreamWriter(bout, "8859_1");
if (titleFound == true){
//Build and write xml document.
out.write( (<?xml version=\"1.0\" "));
out.write(...);
....
out.flush();
out.close();
}
}catch(IOException ioe){
System.out.println(e.getMessage());s
}
}
In my JSP page:
//I will check if there is a file called result.xml. If it is I will
call transfrom()
transform (String pathToXml, String pathToXsl, JspWriter out){
}