Search the web
Sign In
New User? Sign Up
xmlpull-user
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: XmlPullParserException   Message List  
Reply | Forward Message #24 of 308 |
Zoe wrote:

> Quick question for you:
>
> When using xpp I get a bunch of org.xmlpull.v1.XmlPullParserException:
> could not resolve entity named 'blabla'...
>
> How do I tell the parser not to try to resolve any entities?

hi,

XML parser is required to resolve entities. the best way around it is
not to include non-standard XML entities :-) XML 1.0 defined few
standard entity names such as amp (&), lt (<), gt (>), quot
("), and apos (').

if you have no control over input XML documents then you have following
options:

* you can check if DOCDECL is in the input by first calling nextToken()
until you get first START_TAG and to report error to user if you see
DOCDECL event.

* XmlPull allow to do lower-level XML parsing (tokenizing) by using
nextToken() instead of next() in this case entities are not resolved and
instead are reported to you as ENTITY_REF events

* if you know what entities may appear in input then you can pre-declare
them by using defineEntityReplacementText method
(if FEATURE_PROCESS_DOCDECL is not true), for details please see:

http://www.xmlpull.org/v1/doc/api/org/xmlpull/v1/XmlPullParser.html#defineEntity\
ReplacementText
(java.lang.String,%20java.lang.String)

thanks,

alek

--
"Mr. Pauli, we in the audience are all agreed that your theory is crazy.
What divides us is whether it is crazy enough to be true." Niels H. D. Bohr





Mon Feb 10, 2003 5:45 pm

as10m
Offline Offline
Send Email Send Email

Forward
Message #24 of 308 |
Expand Messages Author Sort by Date

... hi, XML parser is required to resolve entities. the best way around it is not to include non-standard XML entities :-) XML 1.0 defined few standard entity...
Aleksander Slominski
as10m
Offline Send Email
Feb 10, 2003
5:46 pm

... interesting idea. i will make optional feature (how IGNORE_UNRESOLVED_ENTITY_REF sounds?) and if set it will make parser to just skip over unresolveable...
Aleksander Slominski
as10m
Offline Send Email
Feb 10, 2003
6:11 pm

... that could be done by adding unescaped entity name into text content (another optional feature?). ... it is hard to know when to call skipNext( )and how to...
Aleksander Slominski
as10m
Offline Send Email
Feb 10, 2003
7:04 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help