Search the web
Sign In
New User? Sign Up
xmlpull-user
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
XMLPullParser set up in Eclipse   Message List  
Reply | Forward Message #290 of 308 |
Re: [xmlpull-user] XMLPullParser set up in Eclipse

Phil Troy wrote:
> 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.
>
calling System.getProperty(XmlPullParserFactory.PROPERTY_NAME) allwos
you to override parser impl class with system property. in case if it is
null then factory loads parse class impl name from special file in
META-INF directory and if you donot have this file it fails

you can by pass it by simply calling:

XmlPullParserFactory.newInstance("org.xmlpull.mxp1.MXParser",null)


or simply

XmlPullParser pp = new org.xmlpull.mxp1.MXParser()

anyway you should not need to do anything like this if you used
xpp3-1.1.4c.jar - in such case factory should just work so i suspect
there must be something eerie in your CLASSPATH project. it may be wort
to create new workspace and bran new project in eclipse and see how
things work in such case.

best,

alek




Mon Apr 2, 2007 4:27 am

as10m
Offline Offline
Send Email Send Email

Forward
Message #290 of 308 |
Expand Messages Author Sort by Date

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...
Phil Troy
philtroy2001
Offline Send Email
Apr 2, 2007
12:24 am

... 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...
Aleksander Slominski
as10m
Offline Send Email
Apr 2, 2007
12:30 am

... correction - i just checked [1] and you should be fine with min version (you need standard for serializer and faster parser) and [1] has ...
Aleksander Slominski
as10m
Offline Send Email
Apr 2, 2007
12:36 am

Dear Aleksander Hi! I bypassed the problem of the missing XmlPullParserFactory class by creating the relevant packages and creating classes within them as ...
Phil Troy
philtroy2001
Offline Send Email
Apr 2, 2007
4:17 am

... calling System.getProperty(XmlPullParserFactory.PROPERTY_NAME) allwos you to override parser impl class with system property. in case if it is null then...
Aleksander Slominski
as10m
Offline Send Email
Apr 2, 2007
4:29 am

Dear Aleksander Thanks for your help; I am very pleased with the ease of using XMLPullParser. Keep up the good work! Phil ... Philip M. Troy, Ph.D., Decision...
Phil Troy
philtroy2001
Offline Send Email
Apr 14, 2007
3:26 pm

THANKS/Phil ... Philip M. Troy, Ph.D., Decision Support Systems Analyst PhilTroy@... www.PhilTroy.com...
Phil Troy
philtroy2001
Offline Send Email
Apr 2, 2007
3:21 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help