[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] How to speed up parsing ??


Subject: RE: [xsl] How to speed up parsing ??
From: "Tengshe, Ashish" <Tengshe.Ashish@xxxxxxxxxxxxx>
Date: Fri, 1 Aug 2003 11:13:09 -0500

OK, it seems like you are using Java right?
(java -ms25M -mx100M xslFileName xmlFileName > directingOutput.txt)

You can parse the document and create a Document object 
  
  DOMParser parser = new DOMParser();
  parser.parse("D:/foo.xml");
  /* You can parse a File or an InputSource, if you have InputStream then just do InputSource s = new InputSource(InputStream) thing. */
  Document document = parser.getDocument();

This Document object is parsed XML. You should store this in memory (Session/whatever else)if you repeatedly need it!

Also if you repeatedly need the same XSL file you should use some caching mechanism. 
Also, XSL files after parsing can be represented by Templates objects

TransformerFactory tFactory = TransformerFactory.newInstance();
Templates t = tFactory.newTemplates(xslSource);
Transformer transformer = t.newTransformer();

these Templates object can be stored in a HashTable in session or something and retrieved when this particular XSL is called again.
This will reduce time. If you need more info, please mail me directly at tengshe.ashish@xxxxxxxxxxxxx

Lastly, try Translets, I've had better results working with large documents (Refer to Mukul Gandhi's post XSLTC)
Thanks,
Ashish



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



Current Thread
Keywords
xsl