diff options
author | Daniel Veillard <veillard@redhat.com> | 2011-11-11 11:25:07 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2011-11-11 13:43:51 +0800 |
commit | cb3549e30a63935fa840d61412abe828b0c6753e (patch) | |
tree | b8da40df853825c94ed38325f8cce298058165f7 | |
parent | 5825ebb26a336d57cf31d0f9534829b74a2f852e (diff) | |
download | android_external_libxml2-cb3549e30a63935fa840d61412abe828b0c6753e.tar.gz android_external_libxml2-cb3549e30a63935fa840d61412abe828b0c6753e.tar.bz2 android_external_libxml2-cb3549e30a63935fa840d61412abe828b0c6753e.zip |
Improve the error report on undefined REFs
Use the tree node to provide the error context instead
of the parser input which is not relevant anymore,
based on a suggestion by François Delyon <f.delyon@satimage.fr>
-rw-r--r-- | result/valid/xlink.xml.err | 4 | ||||
-rw-r--r-- | valid.c | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/result/valid/xlink.xml.err b/result/valid/xlink.xml.err index 08c84bdc..c0eea7c0 100644 --- a/result/valid/xlink.xml.err +++ b/result/valid/xlink.xml.err @@ -1,6 +1,4 @@ ./test/valid/xlink.xml:450: element termdef: validity error : ID dt-arc already defined <p><termdef id="dt-arc" term="Arc">An <term>arc</term> is contained within an e ^ -./test/valid/xlink.xml:530: element termref: validity error : IDREF attribute def references an unknown ID "dt-xlg" - -^ +./test/valid/xlink.xml:199: element termref: validity error : IDREF attribute def references an unknown ID "dt-xlg" @@ -6559,6 +6559,7 @@ xmlValidateCheckRefCallback(xmlListPtr ref_list, xmlValidCtxtPtr ctxt, int xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { xmlRefTablePtr table; + unsigned int save; if (ctxt == NULL) return(0); @@ -6568,6 +6569,10 @@ xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { return(0); } + /* trick to get correct line id report */ + save = ctxt->finishDtd; + ctxt->finishDtd = 0; + /* * Check all the NOTATION/NOTATIONS attributes */ @@ -6581,6 +6586,8 @@ xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { ctxt->doc = doc; ctxt->valid = 1; xmlHashScan(table, (xmlHashScanner) xmlValidateCheckRefCallback, ctxt); + + ctxt->finishDtd = save; return(ctxt->valid); } |