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