Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Problems using XSL inside a plugin
Problems using XSL inside a plugin [message #448771] Mon, 01 May 2006 19:44 Go to next message
Eclipse UserFriend
Originally posted by: sergiohm.yahoo.com

I have a plugin which uses XSL to transform some XML files. The code works
fine outside the plugin. However when I try to run inside the plugin I get
an error because a Java class I've defined in XSL:

xmlns:str-utils="com.acme.util.StringUtil

is not found! Although that class is in the plugin/src folder!

One of the static methods in this class is transformToLowerUpper.

So in my XSL I have:
<xsl:value-of select="str-utils:transformToUpperLower(@name)"/>

I don't understand why the Plugin fails and the error message I get from
XALAN is:



javax.xml.transform.TransformerException: java.lang.NoSuchMethodException:
For extension function, could not find method
org.apache.xml.utils.NodeVector.transformToLowerUpper([Expre ssionContext,] ).



So it is ignoring the definition of my function altogether (it should be in
com.acme.util.StringUtil and not org.apache.xml.utils.NodeVector !).



I know StringUtil should be in the classpath and it is since it is part of
the plugin source (it is in the plugin/src folder).



I've tried placing StringUtil in a JAR but that was worse. I would
appreciate some help.



Tks!
Re: Problems using XSL inside a plugin [message #449079 is a reply to message #448771] Wed, 10 May 2006 07:01 Go to previous message
Eclipse UserFriend
This sounds like a classloading issue. You should have a read of my recent article on EclipseZone http://www.eclipsezone.com/articles/eclipse-vms/ to get an understanding of how classloaders are related.

In this case, you are calling a method into a lower-level (XSL) library, and then it is trying to obtain a class from the higher-level. This will not work. You must do one of the following:

1) Have the XSL code in the same bundle (or a fragment of that bundle) so that it uses the same classloader
2) Have the class in the JRE's extension library so that it's visible by every classloader
3) Set up an import-package in the XSL bundle so that it can see your code
4) Set up the register-buddy policy in the XSL bundle and register yourself as a buddy in the dependent plugin

If none of that makese sense, read the above linked article. If it still doesn't make sense, read it again ...

Alex.
Previous Topic:Remote Debugging
Next Topic:How can I invoke "Source->Organize Imports" code programatically ?
Goto Forum:
  


Current Time: Sun Aug 31 05:54:52 EDT 2025

Powered by FUDForum. Page generated in 0.03144 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top