Enforcing XLTC to recompile a Translet 2005-10-08 - By Postmaster Wolterink Webdesign
I have an webapplication that uses xsl transformations heavily, therefore i use xsltc to improve speed,
My xsl files refer to a couple of other xsl and xml files, like this:
<xsl:variable name="structure" select="document('../../structure.xml')"/> <xsl:include href="./standard.xsl"/> <xsl:include href="../../../style/layout.xsl"/>
What i want: If i change any of the xml/xsl documents then the Translet should be recompiled. (I dont know if this is neccesary for the $structure variable)
What i have now:
private void setupTransformerFactory(TransformerFactory factory) { if(this.useXslCompiler) { factory.setAttribute("translet-name", "Xcm"); factory.setAttribute("destination-directory", filterConfig.getServletContext().getRealPath("/WEB-INF/classes/") ); factory.setAttribute("package-name", "translets"); factory.setAttribute("generate-translet", Boolean.TRUE); factory.setAttribute("auto-translet", Boolean.TRUE); } }
The auto-translet param is set to true, so it should recompile if the main xsl file is edited (am i right?). But it does not work, the Translet is not recompiled! How can this be?
On the xalan site i read: -- auto-translet: Specifies that time-stamp of translet file, if any, should be compared with that of stylesheet to decide whether to recompile the stylesheet --
But this does not work.. How can i get what i want ( recompilation if any of the xsl files change)?
Some system info: Webapps runs on Tomcat 5.5.9 JVM 1.5.0_03 Xalan-j: 2.7.0
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> I have an webapplication that<br> uses xsl transformations heavily,<br> therefore i use xsltc to improve speed,<br> <br> My xsl files refer to a couple of other xsl and xml files,<br> like this:<br> <br> <xsl:variable name="structure" select="document('../../structure.xml')"/><br> <xsl:include href="./standard.xsl"/><br> <xsl:include href="../../../style/layout.xsl"/><br> <br> What i want:<br> If i change any of the xml/xsl documents then the<br> Translet should be recompiled. (I dont know if this is<br> neccesary for the $structure variable)<br> <br> What i have now:<br> <br> private void setupTransformerFactory(TransformerFactory factory) {<br> if(this.useXslCompiler) {<br> factory.setAttribute( "translet-name", "Xcm");<br> factory.setAttribute( "destination-directory",<br> filterConfig.getServletContext().getRealPath("/WEB-INF/classes/")<br> );<br> factory.setAttribute( "package-name", "translets");<br> factory.setAttribute( "generate-translet", Boolean.TRUE);<br> factory.setAttribute( "auto-translet", Boolean.TRUE);<br> }<br> }<br> <br> The auto-translet param is set to true, so it should recompile if the main xsl file<br> is edited (am i right?).<br> But it does not work, the Translet is not recompiled!<br> How can this be?<br> <br> On the xalan site i read:<br> --<br> auto-translet:<br> <font color="#000000"><font color="#000000" size="-1"><font color="#000000" size="-1">Specifies that time-stamp of translet file, if any, should be compared with that of stylesheet to decide whether to recompile the stylesheet <br> --<br> <br> </font></font></font><br> But this does not work..<br> How can i get what i want ( recompilation if any of the xsl files change)?<br> <br> <br> Some system info:<br> Webapps runs on Tomcat 5.5.9<br> JVM 1.5.0_03<br> Xalan-j: 2.7.0<br> <br> </body> </html>
|
|