Sunday, August 28, 2011

Re: [android-developers] corrupted Xml

On Mon, Aug 29, 2011 at 3:07 AM, Nikolay Elenkov
<nikolay.elenkov@gmail.com> wrote:
> On Mon, Aug 29, 2011 at 6:15 AM, bob <bob@coolgroups.com> wrote:
>> I'm using this on Android to fix a corrupted Xml file that's about
>> 2.5MB:
>>
>> xml = xml.replaceAll("&", "&amp;");
>>
>> However, that statement causes an out of memory error.  Any ideas?
>>
>
> Don't read the whole thing as one huge string, process
> it line by line or element by element, whatever works.

If the purpose is to fix broken XML I wouldn't recommend to read by element ;-)

Line by line should be fine.

--
Michael Banzon
http://michaelbanzon.com/

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment