Dom4J doesn't include the jaxen XPath stuff... you have to download and include the jaxen jar if you're going to use any XPaths (and selectNodes invokes the XPath stuff, I think).

Hope that helps...

b

Ryan, Sandy wrote:
Hello all.

I was wondering if anybody on this list might happen to know a good way
of using dom4j from inside of an eclipse plugin?

The follow code works just great when I run it outside of my eclipse
plugin ...

    String packageXPath = "//UML:Package";
System.out.println("No error yet: 1"); java.util.List packageList = xmiDocument.selectNodes(packageXPath); System.out.println("No error yet: 2");
    Iterator iterator = packageList.iterator();
    Element packageElement = null;
    String packageName = "";

    while (iterator.hasNext()) {
      packageElement = (Element)iterator.next();
      System.out.println("element=" + packageElement.asXML());
    } // while

However, when I run it from inside of an eclipse plugin it dies on the
3rd line of code with the following error:

No error yet: 1
Unhandled event loop exception
Reason:
org/jaxen/NamespaceContext


Could this be a class loader issue of some sort?

I've tried wrapping the dom4j lib as another plugin and establishing a
plugin dependency.
http://owl-eclipse.projects.semwebcentral.org/CreateLibraryPlugin.html
That didn't work.

I also tried incorporating the dom4j lib directly into my plugin and
that didn't work either.
http://gregluck.com/blog/archives/2005/08/eclipse_rcposgi.html

Any suggestions would be _greatly_ appreciated.

Thank you,
Sandy


Sandy Ryan
Software Engineer
302-983-8517



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to