You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Neelam Checknita <NC...@burntsand.com> on 2000/06/12 20:20:44 UTC

performance problem using xalan xslt processor.

Hi,

I'm using Xalan version 1.0.1 to do some xslt processing (xsl + xml -->
html).  When I first started the implementation, I didn't have tremendous
amounts of data in my xml, so performance didn't seem to be a problem.
However, now with about 300 xml records, I'm noticing that the conversion is
*extremely* slow:  12 seconds and above for each conversion, which is way
too slow for the web.  Validation is not turned on (at least I haven't
explicitly turned it on).  Does anyone know how I could tune this for finer
performance, or if there's a more effiicient xslt processor out there?

here's a snippet of the code which performs the actual translation:

public static void toHTML(  Writer response,
	                            String xmlData,
            	                Reader xslData)
                                            throws InternalException
  {
    XSLTInputSource xmlSource = null;
    XSLTInputSource xslSource = null;

    // first create xml input source...
    StringReader xml = new StringReader(xmlData);
    if (xml != null)
    {
       xmlSource = new XSLTInputSource(xml);
       if (xmlSource == null)
       {
         throw new InternalException("xml source contains null value");
       }
    } else {
       throw new InternalException("xml string invalid or null");
    }
    // now create the xsl stylesheet....
    xslSource = new XSLTInputSource(xslData);
    if (xslSource == null)
    {
      throw new InternalException("xsl Source contains null value");
    }

    XSLTProcessor xslprocessor = null;
    try
    {
      xslprocessor =
org.apache.xalan.xslt.XSLTProcessorFactory.getProcessor();
      XSLTResultTarget target = new XSLTResultTarget(response);
      xslprocessor.setProblemListener(new XsltProcessor());
      xslprocessor.process(xmlSource, xslSource, target);
    }
    catch (org.xml.sax.SAXException saxExc)
    {

	------------------etc----------------------------------