开发者

How to parse xml content more than 8096 length

开发者 https://www.devze.com 2023-04-11 00:40 出处:网络
I\'m trying to parse an xml file. It is gps coords. So there is a string with latitude coords and with longtitude

I'm trying to parse an xml file. It is gps coords.

So there is a string with latitude coords and with longtitude

You can imagine the size of the string(for example over 29k chars)

When i trying to parse it, I have a problem it parses only 8096. I put a breakpoint in characters(char[] ch, int start, int length) and length only 8096.

I've tried to set bigger buffer to xm开发者_开发问答lreader, maybe trouble with input source. Or saxparser can handle only such length?


Try creating your own class that implements XmlPullParser. You can then simply override the methods that read from the Reader. You can find something about XmlPullParser here


Implementation of saxparser is that it calls characters() many times if string is more than ~8k chars.parsing each part. So you need just use not string for storing data, but StringBuffer or somethin like that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号