diff options
author | Daniel Veillard <veillard@redhat.com> | 2012-08-14 11:01:07 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2012-08-14 11:01:07 +0800 |
commit | 97fa5b3c8f3fe6ff79123ab43ed6b846fd1dd6dd (patch) | |
tree | 164ae64c5d4fcdad50491f058aa8e68e853996b6 /xmllint.c | |
parent | aabc08477cf7b5110bf4594edccfcb8d4611cfde (diff) | |
download | android_external_libxml2-97fa5b3c8f3fe6ff79123ab43ed6b846fd1dd6dd.tar.gz android_external_libxml2-97fa5b3c8f3fe6ff79123ab43ed6b846fd1dd6dd.tar.bz2 android_external_libxml2-97fa5b3c8f3fe6ff79123ab43ed6b846fd1dd6dd.zip |
Fix file and line report for XSD SAX and reader streaming validation
Things now work correctly at the xmllint level:
thinkpad:~/XML -> xmllint --sax --noout --schema test_schema.xsd
test_xml.xml
test_xml.xml:72721: Schemas validity error : Element 'level1': Missing
child element(s). Expected is ( level2 ).
test_xml.xml fails to validate
thinkpad:~/XML -> xmllint --stream --schema test_schema.xsd test_xml.xml
test_xml.xml:72721: Schemas validity error : Element 'level1': Missing
child element(s). Expected is ( level2 ).
test_xml.xml fails to validate
thinkpad:~/XML ->
* error.c: fix a corner case of not reporting lines when we should
* include/libxml/xmlschemas.h doc/symbols.xml: had to add new entry
points to set the filename on a validation context and a locator
callback used to fetch the line and file from the context
* xmlschemas.c: add the new entry points xmlSchemaValidateSetFilename()
and xmlSchemaValidateSetLocator(), plus make sure the error reporting
routine gets the information if available. Add a locator for SAX.
* xmlreader.c: add and plug a locator for readers.
Diffstat (limited to 'xmllint.c')
-rw-r--r-- | xmllint.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1669,6 +1669,7 @@ testSAX(const char *filename) { (xmlSchemaValidityErrorFunc) fprintf, (xmlSchemaValidityWarningFunc) fprintf, stderr); + xmlSchemaValidateSetFilename(vctxt, filename); ret = xmlSchemaValidateStream(vctxt, buf, 0, handler, (void *)user_data); |