libxmljs2 icon indicating copy to clipboard operation
libxmljs2 copied to clipboard

Validation errors - line number overflow

Open joedeveloper opened this issue 5 years ago • 3 comments

Hi, thanks for doing this :)

While I would love some insight into how I can do streaming validation - my immediate problem is as follows for a large files:

[ { message: "Element 'prices': Missing child element(s). Expected is ( price ).\n", line: 16964 }, { message: "Element 'prices': Missing child element(s). Expected is ( price ).\n", line: 17248 }, { message: "Element 'prices': Missing child element(s). Expected is ( price ).\n", line: 65535 }, { message: "Element 'floor_size': '' is not a valid value of the atomic type 'xs:decimal'.\n", line: 65535 }]

as you can see the line number is pegged, how can I go about increasing the range of line values returned?

joedeveloper avatar Oct 06 '20 10:10 joedeveloper

Any news regarding this issue? I'm on 0.26.6 and this is still a problem. I'm validating a file with almost 4 million lines, so the line number is only relevant on the first 2% of the entire file.

rbizarra avatar Feb 23 '21 17:02 rbizarra

Using the big_lines parser option might help. This is a limitation in libxml2 — it stores line numbers internally as a short, so they’re limited to 16 bits on most systems. The big_lines option tries to work around that, but I believe it might be somewhat buggy.

sluukkonen avatar Apr 03 '21 10:04 sluukkonen

Linking to the newer issue: https://gitlab.gnome.org/GNOME/libxml2/-/issues/361

nosvalds avatar Jul 15 '22 08:07 nosvalds