is StylesheetRoot really java.io.Serializable ? 2007-08-01 - By Christine Li
Hi,
It looks like a bug in the code. Please open a bug report for it http://issues.apache.org/jira/browse/XALANJ
By the way, I did some performance comparison long time ago, it showed that serialize and deserialize a Template object is slower than regenerate a Template object from a stylesheet.
If you want to get better performance, you can use XSLTC, you can compile a stylesheet into a translet (a java class), then you can do transformation later. More details please refer to http://xml.apache.org/xalan-j/xsltc_usage.html
Hope it helps,
Christine Li XSLT Development IBM Toronto Lab Tel: (905)413-2601 Email: jycli@(protected)
tiberiu <tiberiu_caprita@(protected)> 01/08/2007 03:42 PM
To xalan-j-users@(protected) cc
Subject is StylesheetRoot really java.io.Serializable ?
Hi, in xalan documentation there is a hint to use Templates and to cache them, in order to increase performance. I need to cache them on disk, so that I tried to use (java.io) Serializable interface. The Problem is that even if StyleSheetRoot (the Templates Object) implements Serializable, ExtensionNamespaceSupport doesn't. So, trying to save a StylesheetRoot with xalan2.4.0 crashes, in 2.7.0 I didn't obtain an error but the read Class from such a File return on method StylesheetRoot.getExtensions() a null. This null is at the end converted in an "Unknown Error in XPath" Error because of the following Code from ExtensionsTable class: Vector extensions = m_sroot.getExtensions(); for (int i = 0; i < extensions.size(); i++) Without these Extensions the Templates doesn't know defined Namespaces. My Question is if it is a possibility to serialize StylesheetRoot in a File, and to can use that serialized form in order to generate a good Transformer. Thanks for an answer. View this message in context: is StylesheetRoot really java.io.Serializable ? Sent from the Xalan - J - Users mailing list archive at Nabble.com.
<br><font size=2 face="sans-serif">Hi,</font> <br> <br><font size=2 face="sans-serif">It looks like a bug in the code. Please open a bug report for it http://issues.apache.org/jira/browse/XALANJ</font> <br> <br><font size=2 face="sans-serif">By the way, I did some performance comparison long time ago, it showed that serialize and deserialize a Template object is slower than regenerate a Template object from a stylesheet. </font> <br> <br><font size=2 face="sans-serif">If you want to get better performance, you can use XSLTC, you can compile a stylesheet into a translet (a java class), then you can do transformation later. More details please refer to http://xml.apache.org/xalan-j/xsltc_usage.html</font> <br> <br><font size=2 face="sans-serif">Hope it helps,</font> <br> <br><font size=2 face="sans-serif">Christine Li<br> XSLT Development<br> IBM Toronto Lab<br> Tel: (905)413-2601<br> Email: jycli@(protected)</font> <br> <br> <br> <table width=100%> <tr valign=top> <td width=40%><font size=1 face="sans-serif"><b>tiberiu <tiberiu_caprita @(protected)></b> </font> <p><font size=1 face="sans-serif">01/08/2007 03:42 PM</font> <td width=59%> <table width=100%> <tr valign=top> <td> <div align=right><font size=1 face="sans-serif">To</font></div> <td><font size=1 face="sans-serif">xalan-j-users@(protected)</font> <tr valign=top> <td> <div align=right><font size=1 face="sans-serif">cc</font></div> <td> <tr valign=top> <td> <div align=right><font size=1 face="sans-serif">Subject</font></div> <td><font size=1 face="sans-serif">is StylesheetRoot really java.io.Serializable ?</font></table> <br> <table> <tr valign=top> <td> <td></table> <br></table> <br> <br> <br><font size=3>Hi, in xalan documentation there is a hint to use Templates and to cache them, in order to increase performance. I need to cache them on disk, so that I tried to use (java.io) Serializable interface. The Problem is that even if StyleSheetRoot (the Templates Object) implements Serializable, <i>ExtensionNamespaceSupport</i> doesn't. So, trying to save a StylesheetRoot with xalan2.4.0 crashes, in 2.7.0 I didn't obtain an error but the read Class from such a File return on method StylesheetRoot.getExtensions() a null. This null is at the end converted in an "Unknown Error in XPath" Error because of the following Code from <i>ExtensionsTable</i> class: Vector extensions = m_sroot.getExtensions(); for (int i = 0; i < <i>extensions.size()</i>; i++) Without these Extensions the Templates doesn't know defined Namespaces. My Question is if it is a possibility to serialize StylesheetRoot in a File, and to can use that serialized form in order to generate a good Transformer. Thanks for an answer. <br> </font> <hr><font size=3>View this message in context: </font><a href="http://www .nabble.com/is-StylesheetRoot-really-java.io.Serializable---tf4202280.html #a11952525"><font size=3 color=blue><u>is StylesheetRoot really java.io.Serializable ?</u></font></a><font size=3><br> Sent from the </font><a href="http://www.nabble.com/Xalan---J---Users-f275.html "><font size=3 color=blue><u>Xalan - J - Users mailing list archive</u></font></a><font size=3> at Nabble.com.< /font> <br>
|
|