aboutsummaryrefslogtreecommitdiffstats
path: root/xmllint.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2012-08-14 11:01:07 +0800
committerDaniel Veillard <veillard@redhat.com>2012-08-14 11:01:07 +0800
commit97fa5b3c8f3fe6ff79123ab43ed6b846fd1dd6dd (patch)
tree164ae64c5d4fcdad50491f058aa8e68e853996b6 /xmllint.c
parentaabc08477cf7b5110bf4594edccfcb8d4611cfde (diff)
downloadandroid_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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/xmllint.c b/xmllint.c
index 78db222c..b58d1843 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -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);