You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Dorsey, Chris" <ch...@bankofamerica.com> on 2001/07/02 20:53:17 UTC

Loading *.xsl into memory

We are currently using xalan-j_1_2_2.  I have heard that you can load your
*.xsl files into memory, so that you don't have to read them from disk every
time.  Is this true?  If so, how is this accomplished?

Thanks in advance for your help,
Chris Dorsey

RE: Loading *.xsl into memory

Posted by Jeff Barr <je...@vertexdev.com>.
What you want to do is to create a compiled style sheet, and then
use it more than once.

Assume the following declarations:

	    XSLTInputSource xisXML = new XSLTInputSource(...);
	    XSLTInputSource xisXSL = new XSLTInputSource(..);
	    XSLTResultTarget resultPw = new XSLTResultTarget(..);

If you had to load and transform like this:

	    processor.process(xisXML, xisXSL, resultPw);

Change it to first load:

	    StylesheetRoot ssrXSL = processor.processStylesheet(xisXSL);

And then transform:

	    ssrXSL.process(xisXML, resultPw);

You can use the same StylesheetRoot (ssrXSL in this example) over and
over again. You will definitely save on processing time.

Let me know if you need more info.

Jeff;

Jeff Barr - Vertex Development - (mailto:jeff@vertexdev.com)
  Address:  4610 191st Place NE. Redmond, WA 98074; 
  Phone:    Office: 425-868-4919 - Home: 425-836-5624
  IM:       MSN: jeffscottbarr@hotmail.com; AIM: jeffscottbarr
  Homepage: http://www.vertexdev.com/~jeff
  Resume:   http://www.vertexdev.com/~jeff/real_jb_resume.html

-----Original Message-----
From: Dorsey, Chris [mailto:chris.dorsey@bankofamerica.com] 
Sent: Monday, July 02, 2001 11:53 AM
To: xalan-dev@xml.apache.org
Subject: Loading *.xsl into memory


We are currently using xalan-j_1_2_2.  I have heard that you can load
your *.xsl files into memory, so that you don't have to read them from
disk every time.  Is this true?  If so, how is this accomplished?

Thanks in advance for your help,
Chris Dorsey