GNOME Bugzilla – Bug 734276
wrong error column in structured error when skipping whitespace in xml declaration
Last modified: 2014-08-07 08:30:26 UTC
Created attachment 282551 [details] Sample XML file, containing an error at line 1 column 53 libxml2 reports wrong error column numbers (field int2 in xmlError) in structured error handler, after an XML declaration containing whitespace. Example XML: <?xml version="1.0" encoding="UTF-8" ?><root>&</root> <!-- 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 --> Expected location of the error would be line 1, column 53. The actual location of the error is line 1, column 44: $ ./xmlparse colbug1.xml colbug1.xml:1:44: xmlParseEntityRef: no name
Created attachment 282552 [details] Simple testcase; parses xml file and reports error via structured error handler $ cc `xml2-config --cflags --libs` -o xmlparse xmlparse.c $ ./xmlparse colbug1.xml colbug1.xml:1:44: xmlParseEntityRef: no name Expected output is: colbug1.xml:1:53: xmlParseEntityRef: no name
Created attachment 282553 [details] [review] Suggested fix - count horizontal whitespace characters
Okay that looks fine too, pushed and commited in git as commit 5d4310af453a2220851b7063ebf165ce8b47494c thanks a lot ! Daniel