Dear Aleksander
Hi!
I bypassed the problem of the missing XmlPullParserFactory class by
creating the relevant packages and creating classes within them as
needed so that I now have the following projects/classes:
- org.xmlpull.v1
- XmlPullParser.java
- XmlPullParserException
- XmlPullParserFactory
- XmlSerializer
- org.xmlpull.mxp1
- MxParser.java
But now, when I run the following statement it throws an exception on
the following line of code
XmlPullParserFactory factory =
XmlPullParserFactory.newInstance(System.getProperty(XmlPullParserFactory.PROPERT\
Y_NAME),
null);
I presume that it is because I am not properly setting the class to
MxParser.java - if that is the problem, can you please tell me how to
do that? I did look at the
Class XmlPullParserFactory documentation, and did see the reference to
Thread.getContextClassLoader().getClass() but I don't know how to get
that to work.
Thanks/Phil
At 20:36 2007-04-01, you wrote:
>Aleksander Slominski wrote:
> > Phil Troy wrote:
> >
> >> Hi!
> >>
> >> I am using Eclipse, and have added xpp3_min-1.1.4c.jar to be an
> >> external jar for my current Eclipse project. I have added imports for
> >> xmlPullParser as follows:
> >>
> >> import org.xmlpull.v1.XmlPullParser;
> >> import org.xmlpull.v1.XmlPullParserException;
> >> import org.xmlpull.v1.XmlPullParserFactory;
> >>
> >> I build my project in Eclipse and get the following error "the
> >> import org.xmlpull.v1.XmlPullParserFactory cannot be resolved.
> >>
> >> (I am guessing that XmlPullParserFactory is not in the jar mentioned
> >> above.)
> >>
> >> How do I fix this problem?
> >>
> >>
> > min version (xpp3_min-1.1.4c.jar) is minimal and it does not have parser
> > factory - you have two options:
> > 1. create parser directly using its public constructor (new MXParser()
> > should work)
> >
> > 2. download standard xpp3 jar version
> >
>
<http://www.extreme.indiana.edu/dist/java-repository/xpp3/jars/xpp3-1.1.4c.jar>h\
ttp://www.extreme.indiana.edu/dist/java-repository/xpp3/jars/xpp3-1.1.4c.jar
> > and then you can use XmlPullParserFactory
> >
>correction - i just checked [1] and you should be fine with min version
>(you need standard for serializer and faster parser) and [1] has
>XmlPullParserFactory so maybe you need to double check your jar file you
>use in Eclipse (and download it again if necessary) - also check if your
>eclipse project classpath settings do nto have duplicate of xpp3/xmlpull
>interfaces/classes
>
>HTH,
>
>alek
>[1]
><http://www.extreme.indiana.edu/dist/java-repository/xpp3/jars/xpp3_min-1.1.4c.\
jar>http://www.extreme.indiana.edu/dist/java-repository/xpp3/jars/xpp3_min-1.1.4\
c.jar
>
>
Philip M. Troy, Ph.D.,
Decision Support Systems Analyst
PhilTroy@...
www.PhilTroy.com