You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Samuel Fung <bl...@i-cable.com> on 2000/07/21 09:26:38 UTC

problem using serialized StylesheetRoot object

Hi all,

    I am using Xalan-J to convert an xml document to html output.
The stylesheet involved is pretty large (I think). It's about 15Kb.
So I want to supply my problem with an already compiled stylesheet
(in Xalan format) rather than the plain xsl stylesheet, just hope
to speed things up a bit. (Please let me know if it really works). So I use
XSLTProcessor.processStylesheet() to first get a StylesheetRoot
representation of the xsl stylesheet. Then I serialize it 
using java.io.ObjectOutputStream. The Xalan version I use
is 1.1. The process does not work because 
org.apache.xalan.xpath.xml.StringToStringTable does not implements
java.io.Serializable. So I went to the source file and added
"implements Serializable" after the class declaration statement.
It compiled okay and I put it into xalan.jar file. This time the
serialization output works.

   The offline serialized object loads fine. But when I try to
use it with XSLTProcessor.process(), I got the following
exception:

XSLT Error
       at org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1630)
       at org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1594)
       at org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:655)
       at toolbox.toHTMLBody(toolbox.java:224)
       at toolbox.toOfflineBody(toolbox.java:156)
       at convert.main(convert.java:49)

   So, my question is that whether it is possible to serialize
StylesheetRoot object. Thanks

Samuel