xsl-list
[Top] [All Lists]

transformation much slower in a servlet???

2002-09-16 15:00:42
Hi,

I have an xml that is about 580k and I can transform it into an html with an 
xsl with xalan at my command line. It takes about 5 seconds.  This is my 
command line statement:

java org.apache.xalan.xslt.Process -in xml.xml -xsl xsl.xsl -out output.html

When I move this process to a servlet, I am getting about 25 seconds to 
transform the same xml into the same html.  Here is a snippet from my servlet.

servlet code:
---------------------
//sets up the xml file to transform
File xmlFile = new File(xml.xml);

//sets up the xsl file to do the transforming
File xsltFile = new File(xsl.xsl);

Source xmlSource = new StreamSource(xmlFile);
Source xsltSource = new StreamSource(xsltFile);
        
TransformerFactory transFact = TransformerFactory.newInstance();
Transformer trans = transFact.newTransformer(xsltSource);

PrintWriter pw = new PrintWriter(new FileOutputStream(htmlFile));

trans.transform(xmlSource, new StreamResult(pw));
---------------------

I am using a number of keys in the xsl and I reference another xml file with 
the document() xsl function in xsl.xsl.  Could this be the cause of my delay?  
Is there anyway to track what's happening in the xsl transformation when it is 
in a servlet?

is there anyway to find out how a transformation at the command line would take 
less than a transformation in a servlet.  I see no errors in my console when 
the servlet is transforming.

thanks for any help you can provide.
will

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>
  • transformation much slower in a servlet???, Carter, Will <=