Hi,
WRT the "new Compiler" problem, xalan developers removed static methods from the FunctionTable class.
Now, when they instantiate a new Compiler, they pass an instance of a function table to the Compiler instead of having the Compiler use static methods of FunctionTable.
Previously-static methods of FunctionTable have been changed to instance methods (apparently security changes?).
e.g. whereas previously org.apache.xpath.compiler.Compiler did this:
Function func = FunctionTable.getFunction(funcID);
Now it does this:
Function func = m_functionTable.getFunction(funcID);
(Where m_functionTable is the reference to the FunctionTable passed to the ctor of Compiler).
For an example of how the FunctionTable is created to be passed to compiler,
see source for org.apache.xpath.XPath class. Here's the diff for that class
showing the changes to use the new Compiler API:
http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xpath/XPath.java?r1=1.31&r2=1.32&diff_format=h <http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xpath/XPath.java?r1=1.31&r2=1.32&diff_format=h>
Instantiating a FuntionTable is simple - org.apache.xpath.XPath does it like this:
/ /**
* The function table for xpath build-in functions
*/
private transient FunctionTable m_funcTable = null;
/**
* initial the function table
*/
private void initFunctionTable(){
m_funcTable = new FunctionTable();
}/
So, /cmp = new Compiler(errorListener, null, new FunctionTable()); /(in org/apache/xindice/core/query/XPathQueryResolver)
would work, but probably better to cache the FunctionTable
instance somewhere instead of recreating it.
However, fixing this issue means that xindice must upgrade to the latest release of xalan (and that may cause problems for people who must use older release for some other reasons).
Could use reflection to detect which constructor is available (old or new) and be compatible with either old or new xalan library.
-Terry
Vadim Gritsenko wrote:
Hi All,
It seems that Xalan XPath API has been changed [1] some time ago, this change was not backward compatible, and old method was not deprecated but removed completely. This can be seen in Gump messages [2] (snippet below).
Would it be possible to re-instate old API, you can make it deprecated, but please provide smooth migration path for the downstream projects?
Xindice depends on old API, and without deprecation messages it's not possible to see what is the proper migration path.
Thanks, Vadim
[1] http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xpath/compiler/Compiler.java?r1=1.37&r2=1.38&diff_format=h
[2] http://marc.theaimsgroup.com/?t=109761492700003&r=1
-------- Original Message --------
Subject: [EMAIL PROTECTED]: Project xml-xindice (in module xml-xindice) failed
Date: Mon, 21 Feb 2005 02:17:47 PST
From: Sam Ruby <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
To whom it may engage...
[javac] /home/gump/workspaces2/public/workspace/xml-xindice/java/src/org/apache/xindice/core/query/XPathQueryResolver.java:163: cannot resolve symbol
[javac] symbol : constructor Compiler (org.apache.xml.utils.DefaultErrorHandler,<nulltype>)
[javac] location: class org.apache.xpath.compiler.Compiler
[javac] cmp = new Compiler(errorListener, null);
[javac] ^
[javac] 1 error