Re: Shortcutting a SAX parser

Petr Pajas <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
On čt 9. dubna 2009, Petr Pajas wrote:
> On čt 9. dubna 2009, Robin Berjon wrote:
> > On Apr 9, 2009, at 10:20 , Michael Ludwig wrote:
> > > Robin Berjon schrieb:
> > >> One (tenuous) lead is that start_element is eventually
> > >> called by XML::LibXML somewhere up the stack, and that's XS,
> > >> which on occasion can lead to surprises. Can you try running
> > >> the same code with XML::SAX::PurePerl?
> > >
> > > Bingo, that makes a difference! Using the PurePerl parser, no
> > > error message stringification occurs.
> >
> > Excellent! I don't know if Petr is following this thread, but
> > in case he isn't I'd recommend filing a bug against
> > XML::LibXML.
>
> Dahut! Robin,
> I am, now that I read that LibXML is blamed:-) I'll look into it
> (and I also confirm that I can reproduce it).
> Best,
> -- Petr

Ok, so turns out that in the dispatching C code we had an explicit 
stringification of ERRSV for no apparent reason. The fix is the 
following change (all occurrences):

    if (SvTRUE(ERRSV)) {
-        STRLEN n_a;
-        croak(SvPV(ERRSV, n_a));
+        croak(Nullch);
     }

I committed the fixed version to SVN.

Thanks also for the test case, I added a simplified version to our 
test suite.

-- Petr
	
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
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.