Re: [xml] bug when parsing html?



On Thu, Oct 21, 2010 at 12:45:42PM +1300, Bevan Collins wrote:
I finally got to the bottom of a problem I was having when parsing html from
a thread other than the main thread.
In the function xmlInitializeGlobalState in globals.c,
inithtmlDefaultSAXHandler is only called if LIBXML_LEGACY_ENABLED is
defined.
Maybe it is documented somewhere that legacy APIs need to be enabled in
order to parse html on a non-main thread, but I never saw it.

  Hum ... it's more a problem of using SAXv1 instead of SAXv2
the SAXv2 default handler is initialized by htmlDefaultSAXHandlerInit()
which is being called by xmlInitParser.
And as the doc says
  http://xmlsoft.org/threads.html
xmlInitParser() should be called from main if you use threads...
  For the SAXv1 handlers they are deprecated, hence the need for
LIBXML_LEGACY_ENABLED to be on

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]