Got this at work a couple of weeks ago, just got around putting it out here.
We use abdera1.0 to parse XML from a restful call:
org.apache.abdera.parser.stax.FOMParser feedParser = new org.apache.abdera.parser.stax.FOMParser();
InputStream in =new URL("http://randomdonkeys.com/give_me_my_donkey.atom").openStream();
Document<Feed> feedDoc = feedParser.parse(in);
The .parse call threw the WstxException. After digging around discovered that the abdera1.0 jar has issues with parsing ChunckedInputStream. I was able to get around it by wrapping the InputStream in InputStreamReader:
Document<Feed> feedDoc = feedParser.parse(new InputStreamReader(in));
Hope this helps someone at some point.
Thank you!!!!! That worked.
ReplyDeleteGlad the post was useful! Thanks for leaving a note :) Cheers!
DeleteThanks a lot!!!!!! It worked
ReplyDeleteHappy it helped :)
ReplyDelete