I raised this issue on the saxon list about two years ago, for similiar
reasons, and it made it's way to the Saxon enhancement suggestion list. I
recall Michael commenting on a similiar request, made later, that he looked
into it and came to the conclusion that the most sensible serializable
representation of a templates object is just the text for the stylesheet.
In retrospect I think that's right. In any case it's the only portable
solution in a distributed environment, since there's no guarantee that one
vendor's transformer in a particular environment would be able to read
another vendor's serialized templates object. And if it's the text that we
want, there's not much point using Java serialization.
----- Original Message -----
From: "Sean Reilly" <sreilly@...>
Sent: Tuesday, July 02, 2002 7:05 PM
Subject: [saxon] net.sf.saxon.PreparedStyleSheet does not implement
I noticed that (in Saxon 7.1) net.sf.saxon.PreparedStyleSheet does not
This isn't a bug per se, as there is nothing requiring a class that
extends javax.xml.transform.Templates to be Serializable. However,
PreparedStyleSheet not being Serializable limits certain actions with
compiled stylesheets, especially in a distributed environment. In
particular, a PreparedStyleSheet cannot be cached to disk (either
between VM lifecycles, or during a single invocation to save memory) or
transferred between 2 virtual machines in a distributed environment.
IMHO, an instance of Templates is a natural cache point given its thread
safety requirements. Also, a Templates must be reconstructed into a
Transformer before it can be used, so any information required to
perform a transformation (that isn't amenable to serialization) could be
provided to the PreparedStyleSheet when the new Transformer is created
Is marking PreparedStyleSheet serializable something you would be
willing to consider for a future release of saxon?
Programmer, Point2 Technologies, Inc.
As you may have noted from the above, I am familiar with JAXP, but have
no experience using saxon directly (except as a pluggable JAXP
provider); I may be missing something saxon specific that would make
marking net.sf.saxon.PreparedStyleSheet Serializable a problem. If so,
please let me know.
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
saxon-help mailing list