Re: [xml] How to continue reading with a xmlTextReader after warning?



On Sat, Sep 26, 2009 at 12:49:21AM +0200, Daniel Franke wrote:

Hi all.

I got stuck reading a file with relative URI as xmlns specification, e.g 
xmlns:foo="./bar/[...]". 

On xmlTextReaderRead(), a warning is generated (relative URIs are deprecated) 
and the return value is '-1'. As I know that the files in question contain 
this problem, I'd like to skip this particular error. Subsequent calls to 
xmlTextReaderRead() seem not to advance to any of the later nodes but always 
return '-1'. Thus I assume that one would somehow need to reset the internal 
state of the xmlTextReader after the first return of '-1' - but there seems to 
be no (obvious) way to do so?! Using xmlReadFile(), the same warning is 
issued, but the tree is available afterwards.

This seems to be quite similar to a previous problem [1,2], there the URI was 
empty, not relative?!

  Hum that sounds like an old bug, did you try with 2.7.5, if you can
confirm it's still there I will chase it down,

Author: Rob Richards <rrichards cdatazone org>  2009-04-29 16:09:05
Committer: Rob Richards <rrichards cdatazone org>  2009-04-29 16:09:05
    * parser.c: do not set error code in xmlNsWarn

  thanks !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]