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

Re: [xml] CDATA sections do not count line numbers via SAX2 API



On Mon, 22 Dec 2003 10:56:34 -0500, Daniel Veillard <veillard redhat com> wrote: 
>   Hum, I glanced over your code. I hate SAX ... callback based code is
> just the worse design possible when it comes to understanding foreign 
> code or debugging.
> I'm not sure xmlSAXLocatorPtr still work. The way the line number is extracted
> from a context is from ctxt->input informations. If your code gets
> it that way through xmlSAX2GetLineNumber() then that should work, that's how
> xmllint itself gets them.

I changed the code to use xmlSAX2GetLineNumber and
it gives me exactly the same incorrect answers.

I replaced the column callback with xmlSAX2GetColumnNumber and it gives
entirely different and still wrong answers (the column should be ~35)

Before:
$ ./cdata_bug a.xml
line 6 column 25 error - xmlParseEntityRef: expecting ';'
$ ./cdata_bug b.xml
line 8 column 25 error - xmlParseEntityRef: expecting ';'

After (with xmlSAX2GetLineNumber / xmlSAX2GetColumnNumber):
$ ./cdata_bug a.xml
line 6 column 96 error - EntityRef: expecting ';'
$ ./cdata_bug b.xml
line 8 column 63 error - EntityRef: expecting ';'

Dave



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