dcsimg
poor performance: XSLT Transformation using javax.xml.transform.Transformer
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Amit_Sanghai
Posted On:   Thursday, January 17, 2008 08:39 AM

Hi, In a JSP I am using javax.xml.transform.Transformer to transform xml data, but it takes a lot of time (25 seconds approx). Here is the code TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(xslFile)); // Setup input for XSLT transformation Source src = new StreamSource(xmlFile); // Result Result res = new StreamResult (out) ; Profiler.log ("L401_NC_WholeLife_ViewProposal printing and transforming", true, true) ; // Start XSLT transformation //transformer.setParameter("hostURL", path) ; transformer.transform(src, res) ; out.flus   More>>

Hi,

In a JSP I am using javax.xml.transform.Transformer to transform xml data, but it takes a lot of time (25 seconds approx). Here is the code


TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new StreamSource(xslFile));

// Setup input for XSLT transformation
Source src = new StreamSource(xmlFile);

// Result
Result res = new StreamResult (out) ;

Profiler.log ("L401_NC_WholeLife_ViewProposal printing and transforming", true, true) ;

// Start XSLT transformation
//transformer.setParameter("hostURL", path) ;
transformer.transform(src, res) ;
out.flush() ;



Here is the out the implicit JSP writer object.

When I store this transformed html in a file, that file also takes a lot of time to open.

I have lots of XSL files which I have included a main XSL file, which I am using like this:
			
Transformer transformer = factory.newTransformer(new StreamSource(xslFile)) ;


This XSL file is very big.

Can somebody please help? Thanks    <<Less

Re: poor performance: XSLT Transformation using javax.xml.transform.Transformer

Posted By:   Amit_Sanghai  
Posted On:   Thursday, January 17, 2008 08:41 AM

Sorry, the code is:


TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new StreamSource(xslFile));
Source src = new StreamSource(xmlFile);
res = new StreamResult (out) ;
transformer.transform(src, res) ;
out.flush() ;
About | Sitemap | Contact