Like the others said.. it sounds like a starting element is not being found
before either some text or an end tag. Usually you'll see that error with
something like:

<node1>
  </node2>
  <node3>
   </node3>
</node1>

Or

<node1>
</node1>
  some text
<node2>
</node2>

It ALSO depends on how you are moving thru the xml parser.. if you are using
parser.next() you are moving one parsing element at a time, which means
you'll find every possible element including text, tags,white space, etc. If
you use parser.nextTag() you may skip over that 2nd example text issue and
find node2 start tag.


On Wed, Feb 3, 2010 at 2:29 PM, Nicholas Albion <[email protected]> wrote:

> If you determine that the problem is that the XML (or HTML!) is badly
> formatted and you have no control over it, you can do something like:
>
> int n;
> while( (n = xpp.getNext()) != END_DOCUMENT ) {
>  try {
>     // do your parsing element-by-element
>  } catch( org.xmlpull.v1.XmlPullParserException e ) {} // ignore the
> exception
>  } catch( Throwable e ) {
>     log.warning("error while parsing file: " + e.getMessage();  //
> you may want to catch any other exceptions and do something about them
>  }
> }
>
> It might not be the most efficient practice to perform the try/catch
> within the loop, but if somebody else is sending you dodgy XML there
> might not be anything you can do.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

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

Reply via email to