[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Class loader problem

Is there a way to affect the classpath at runtime within the workbench?
Here is the scenario I am trying to develop:

The xalan processor supports calling Java beans. That is, in an XSL
stylesheet, one can write something like this to declare a bean
order.PurchaseBean, and then to call a method getOrderId during the
transform process.

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
   ...
    xmlns:user0="class:order.PurchaseBean"
    exclude-result-prefixes="user0">
<xsl:variable name="getOrderId" select="user0:getOrderId()"/>

If on a command line, I set up my classpath to include the jars for the
bean, I can invoke xalan passing this XSLT and an XML doc and it will
create a new XML doc.

However, I am having problem doing this within an XSL Trace Editor that
runs within the workbench. I can set up my build path to build my bean,
and I can also invoke xalan correctly, but somehow I cannot affect my
classpath in such a way that Xalan can find the PurchaseBean.

If I add the PurchaseBean.jar into one of my plugin.xml before I start the
Workbench, then it will work, but clearly this is not what I want to tell
the user to do. Is there a programmatic way that I can alter the classpath
at run time within an editor that runs in an eclipse project?