0

Please someone help me to parse this block of code using android's XmlPullParser (nothing else):

<div fontStyle="normal">
    <p textAlign="center">
        <span fontSize="26">dontneedthis</span>
    </p>
    <p>description1</p>
    <p>description2</p>
    <p>description3</p>
</div>

I need to get only concatenated description1+description2+description3

Seems very easy, but I have problems skipping <p textAlign="center">...</p> because I dont need that and get only other <p>'s TEXT

The whole document is huge, I've parsed all other parts except this one. Ive wrote some code, its huge, parsing is working (and I can get what exactly I need just with few nodes). Document is huge and its hard to catch the error. Maybe your alternative code can help me.

This is a good tutorial, but it doesn't solve my problem

Vishal Pawar
  • 4,324
  • 4
  • 28
  • 54
pleerock
  • 18,322
  • 16
  • 103
  • 128
  • @KonstantinPribluda Thanks Ive solved my problem. Please see my answer. The problem wasn't in code. Ive change parser class from KXmlParser to XmlBlock (without changing code - they implement same interface). It seems KXmlParser has limitation on the reading (seeking?) data... – pleerock Oct 31 '12 at 08:32
  • Why at all you are using foreign pull parer on android? There is one provided by system – Konstantin Pribluda Oct 31 '12 at 10:17
  • Its not foreign pull parer (http://developer.android.com/training/basics/network-ops/xml.html#choose) – pleerock Nov 01 '12 at 05:57

1 Answers1

0

Problem seems related to this post. KXmlParser (implementation of the XmlPullParser) throws error when it cursor position gets 8192. Its a limit. I didnt find any documentation how to change this limit. So now Im using compile xml file (XmlBlock implementation of the XmlPullParser)

Community
  • 1
  • 1
pleerock
  • 18,322
  • 16
  • 103
  • 128