GNOME Bugzilla – Bug 734363
no error column in structured error handler for xml schema validation errors
Last modified: 2014-08-07 03:43:57 UTC
libxml2-2.9.1 or git-snapshot 2014-08-05: When using xml schema validation, structured error callbacks do not get passed a valid column number in xmlError field "int2". $ ./xmlsaxparse colbug5.xml colbug5.xsd colbug5.xml:3:0: Element '{urn:colbug5}bx': This element is not expected. Expected is ( {urn:colbug5}b ). The schema error is reported for line 3, column 0 (= N/A). I'd like to have the column number of the error passed in the xmlError structure. With this test case: line 3, column 9.
Created attachment 282706 [details] xml test case, contains a schema validation error at line 3, column 9
Created attachment 282707 [details] xsd schema file for test case
Created attachment 282708 [details] Test program using stream parser and validation Compile and run like this: $ cc `xml2-config --cflags --libs` -o xmlsaxparse xmlsaxparse.c $ ./xmlsaxparse colbug5.xml colbug5.xsd colbug5.xml:3:0: Element '{urn:colbug5}bx': This element is not expected. Expected is ( {urn:colbug5}b ). schema validation error 1871 Expected output is "colbug5.xml:3:9:..." instead of "colbug5.xml:3:0:..."
Created attachment 282710 [details] [review] Proposed patch for stream mode validation
Yes that looks fine, applied and commited as git commit d201e71ed0df1dce7aca232f81a1c3e2eee8be73 thanks ! Daniel