Re: XmlPullParserException

Aleksander Slominski <[email protected]>
Newsgroups gmane.text.xml.xmlpull.devel
Message-ID <[email protected]>
Zoe wrote:

>
> On Monday, Feb 10, 2003, at 19:10 Europe/Zurich, Aleksander Slominski 
> wrote:
>
>> interesting idea. i will make optional feature (how 
>> IGNORE_UNRESOLVED_ENTITY_REF sounds?) and if set it will make parser 
>> to just skip over unresolvable entities without reporting error or 
>> putting anything into reported XML content.
>>
>> how does it sound?
>
>
> Sounds good... but... I need the value of the entity (resolved or not) 
> to be put in the TEXT content... this is because, even if it's not 
> valid as far as xml goes... it might be valid in, say, html... so I 
> would prefer not to loose the information entirely... 

that could be done by adding unescaped entity name into text content 
(another optional feature?).

> Also, considering all the invalid xml floating around... would it be 
> possible to have something along the line of skipNext() or perhaps a 
> new type like INVALID_XML or something... that would allow the parser 
> to keep going even if it encounters some unorthodox content? 

it is hard to know when to call skipNext( )and how to recover from lot 
of errors (for example user that have unclosed quotation mark ...) or 
what to do with reported INVALID_XML - start tag content may be also 
invalid not only element text

> Thoughts?

that would mean even more of bad/pseudo XML around the same way as HTML 
browsers allow and deal with incorrect input *but* this is our internet 
(or RSS) reality and we have to deal with it.

to solve it i would like to think about some (required) interface to 
report to user all problems with XML (that were ignored) so this could 
be presented by GUI and help to resolve XML incompatibilities with the 
author of XML -i am not sure what would be the best way to do it, maybe 
just require user to retrieve Enumeration with strings containing error 
description with line/number position...

so i was thinking about
* optional feature LENIENT_XML_FEATURE that would allow parser to skip 
recoverable errors (like non existing entity ref)
* optional feature LENIENT_XML_LEAVE_ENTITY_FEATURE to report entity ref 
in element content (and not have it removed)
* optional property REPORT_LENIENT_XML_PROPERTY that would be used to 
retrieve Enumeration to read description of XML problems.

as long as it is optional feature and there is enough interest/use cases 
for it i see no reason why not add it to XPP3.

if you send to me patch of modifications where you think XPP3 should be 
more forgiving for not 100% correct XML i can look into adding them into 
XPP3.

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



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/LIgTpC/vN2EAA/xGHJAA/2U_rlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.