On Thu, Jul 10, 2008 at 10:07:07AM +0100, Rachael Churchill wrote:
> Daniel Veillard wrote:
> > What kind of modifications ? I'm wondering ...
> >
> >Daniel
> >  
> I made a slight change to xmlParseTryOrFinish (and similarly 
> htmlParseTryOrFinish) to change the conditions under which it merges 
> consecutive calls to the character callback.
> 
> It seemed to be merging them even when I thought it shouldn't, e.g. if 
> the user data or the function pointers to the handlers had changed 
> between calls. So if I tried to parse the text "foo" with user data X, 
> and then the text "bar" with user data Y, it seemed to queue them up and 
> parse the whole lot ("foobar") at the end, when the user data was Y. 
> This was bad because I wanted the user data to be X when "foo" was being 
> parsed.
> 
> (It could be that I've misunderstood something, or am calling the 
> function wrongly in some way; feel free to correct me if so.)

  Well yes in libxml2 you can't make any assumption of when or how many
times the character() SAX callback is called for a given text node. What
you're trying to do is beyond what I can garantee (and may break for
example if there is an entity reference in the text node).

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to