xsl-list
[Top] [All Lists]

Re: [xsl] method transform (JAXP)

2008-05-08 05:00:14
After quickly looking at the Java APIs, following comes to my mind:

StringWriter sw = new StringWriter();
StreamResult sr = new StreamResult(sw);
transformer.transform(new StreamSource(sourceId), sr);
StringBuffer sb = sr.getBuffer();

This has not been tested.

On 5/8/08, IZASKUN GUTIERREZ GUTIERREZ 
<igutierrez027(_at_)ikasle(_dot_)ehu(_dot_)es> wrote:
Hello everybody!

I am using JAXP to execute templates.In the method transformer.transform ,
the

second parameter is one StreamResult. I can obtain the result in a File like

this:


File output = new File
("C:/Users/Izaskun/Desktop/workspace5/modelo/mayo.txt");
transformer.transform(new StreamSource(sourceId), new StreamResult(output));


I need to obtain the result in a var String because the result is only one
line

 and I dont know how to do it, because I tried a lot of forms but I dont
obtain

this.

Could anybody help me?

Regards,

Izaskun


-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>