[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Apache Xalan-J XSLTC: how to set for on-demand XSL com

Subject: Apache Xalan-J XSLTC: how to set for on-demand XSL compilation
From: Gaurav <Gaurav.Gandhi@xxxxxxx>
Date: Sat, 29 Nov 2003 00:14:11 +0530
transformerfactory setattribute
Summary:

I am trying to use Xalan-J's compilation based TransformerFactory to create "Translets" on the fly. But dont know how to do that.
(http://xml.apache.org/xalan-j/xsltc_usage.html)


Details:

I set the concerned system property to point to Xalans compilation based Transformer

Properties props = System.getProperties();
props.put("javax.xml.transform.TransformerFactory", "org.apache.xalan.xsltc.trax.TransformerFactoryImpl");


and then set a couple of attributes as follows:

transformerFactory.setAttribute("translet-name", convId);
transformerFactory.setAttribute("destination-directory", "/uwc_base/dist/JDK1.4_DBG.OBJ/WEB-INF/lib");
transformerFactory.setAttribute("package-name", "com.blah.translets");
transformerFactory.setAttribute("jar-name", "iabs-translets.jar");
transformerFactory.setAttribute("generate-translet", Boolean.TRUE);
transformerFactory.setAttribute("use-classpath", Boolean.TRUE);
....
_templates = transformerFactory.newTemplates(new DOMSource(xslDoc));


Now, the "use-class" property = true, indicates that the the TransformerFactorty should expect a precompiled Translet (Java Class representation of XSL) at the ClassPath.
For this I will have to make sure that the translet is generated before the application starts.


If "use-class" property = false, the TransformerFactory will compile the XSL into translet on its own.

I would like a way where XSLTranformerFactory determines on its own whether a Translet is already existing. If yes, it shoud use it, and if no it should generate it.
Is there a way that can be done by setting some attribute of the factory, and without me having to write code to check the presence of the translet.
I read from somewhere that setting the attribute "use-from-classpath" to true, accomplishes that, but looks like the XSLTC factory does not support that attribute.


Gaurav



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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.