mmidy 00/11/29 13:55:36
Modified: src/org/apache/xalan/xslt Stylesheet.java
StylesheetRoot.java
Log:
Fix problem causing with precompiled stylesheets. m_xpathFactory was not
being initialized. Thanks for the patch Dimitry Voytenko!
Revision Changes Path
1.39 +13 -2 xml-xalan/src/org/apache/xalan/xslt/Stylesheet.java
Index: Stylesheet.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/Stylesheet.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- Stylesheet.java 2000/11/20 17:48:49 1.38
+++ Stylesheet.java 2000/11/29 21:55:31 1.39
@@ -1272,7 +1272,7 @@
* XPath object to use for short evaluations, so we don't have to
* create one every time.
*/
- private XPath m_xpath = null;
+ transient private XPath m_xpath = null;
/**
* Factory for creating xpaths.
@@ -1307,12 +1307,23 @@
m_xpath.installFunction("document", new FuncDocument());
m_xpath.installFunction("format-number", new FuncFormatNumb());
}
+
+ /**
+ * Check that XPath related fields were initialized.
+ * If not, initialize them.
+ * Patch from Dimitry Voytenko
+ */
+ void checkInit(XSLTEngineImpl processor)
+ {
+ if (m_xpathFactory == null)
+ initXPath(processor, null);
+ }
/**
* The query/pattern-matcher object.
*/
- XPathProcessor m_xpathProcessor = null;
+ transient XPathProcessor m_xpathProcessor = null;
/**
* Evaluate an xpath string and return the result.
1.40 +1 -0 xml-xalan/src/org/apache/xalan/xslt/StylesheetRoot.java
Index: StylesheetRoot.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/StylesheetRoot.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- StylesheetRoot.java 2000/11/27 21:15:43 1.39
+++ StylesheetRoot.java 2000/11/29 21:55:32 1.40
@@ -314,6 +314,7 @@
IOException
{
XSLTEngineImpl processor = (XSLTEngineImpl)iprocessor; // TODO: Check
for class cast exception
+ checkInit(processor);
synchronized(processor)
{
processor.switchLiaisonsIfNeeded(sourceTree, outputTarget.getNode());