Re: [xml] Line numbers stored by libxml2
- From: Mike Hommey <mh glandium org>
- To: Daniel Veillard <veillard redhat com>
- Cc: xml gnome org
- Subject: Re: [xml] Line numbers stored by libxml2
- Date: Wed, 10 Oct 2007 11:33:00 +0200
On Wed, Oct 10, 2007 at 04:57:46AM -0400, Daniel Veillard <veillard redhat com> wrote:
On Tue, Oct 09, 2007 at 07:43:36PM +0200, Mike Hommey wrote:
Hi,
I got a report against the debian package containing xmllint [1] about
the fact that lines above 65535 are incorrectly reported as line 65535,
at least in schema validation reports.
The problem here is that the xmlNode struct only stores the line number
as an unsigned short, which explains the saturation at 65535. Now,
changing this the basic way will obviously break ABI, so I'm wondering
if
- you consider this bug a bug, or don't care about xml files with more
than 65535 lines,
I consider that no normal user is gonna use an editor to edit a file at line
100,000 . Such a file is gonna be machine generated. The fix will be to fix the
generator, and the likelyhood of having the same error occur before 65,535 is
high enough that they can get the context from another occurence very probably.
Also if using such document you usually use streaming interfaces, so the
parsing context is available and ctxt->input->line is a 32 bit int which can
be looked at to check if needed and complement the missing bit without
changing the APIs or ABIs
The only problem is that it seems that schema error handling doesn't report
line numbers when using the stream API (xmllint --stream --schema).
I guess fixing this would be a better solution, at least for the debian user
who reported the bug.
Mike
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]