Hi there all,
I know this has been discussed before but despite that
I am still having difficulty getting this to work.
http://aspn.activestate.com/ASPN/Mail/Message/Jython-users/1636130
I am using Jython 2.2a0 on java1.4.2 (JIT: null).
What I am trying to do is use jdom, the xml parser (www.jdom.org).
However, I am trying not to have the jdom.jar file in my
classpath. I want to be able to add the jar file dynamically.
Note that it works when I've the jar file in my classpath.
Anyway, I have tried the following.
#-- cut here
import sys
sys.add_extdir( "d:\\java" ) # where my jdom.jar is in subdir d:\java\
from org.jdom.input import SAXBuilder
builder =3D SAXBuilder( 0 )
#-- end here
However, I get this error
>>> ImportError: cannot import name SAXBuilder
Some more info
I tried
>>> import org.jdom.input
>>> >>> dir( org.jdom.input)
['BuilderErrorHandler', 'DOMBuilder', 'DefaultJDOMFactory', 'JDOMFactory'=
, 'JDOM
ParseException', 'SAXBuilder', 'SAXHandler', '__name__']
So the name is there, yes?
What am I doing wrong?
Many thanks in advance,
Chai
######################################################################
Attention:=20
The information in this electronic mail is privileged and
confidential, intended only for use of the individual or entity named.
If you are not the intended recipient, any dissemination, copying or
use of the information is strictly prohibited. If you have received
this transmission in error, please delete it immediately from your
system and inform us via mailto ops@...
This e-mail has been scanned and cleared by MailMarshal=20
######################################################################
|