summaryrefslogtreecommitdiff
path: root/valid.c
diff options
context:
space:
mode:
authorWilliam M. Brack <wbrack@src.gnome.org>2004-10-23 18:14:36 +0000
committerWilliam M. Brack <wbrack@src.gnome.org>2004-10-23 18:14:36 +0000
commit367df6e7e1798a55820d96ca0ee070b638b26d29 (patch)
treefd31d5c4cc729b32fe32ad4348cc0f47c471e079 /valid.c
parentfc484dd0a01b5f8f2187dd8a6791d5f8677fa816 (diff)
downloadlibxml2-367df6e7e1798a55820d96ca0ee070b638b26d29.tar.gz
unlinked the internal subset within xmlValidateDtd (bug 141827) added
* valid.c: unlinked the internal subset within xmlValidateDtd (bug 141827) * configure.in: added -Wall to developer's flags * doc/examples/reader4.res: added to CVS
Diffstat (limited to 'valid.c')
-rw-r--r--valid.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/valid.c b/valid.c
index 6b2d08ec..2ce83b13 100644
--- a/valid.c
+++ b/valid.c
@@ -6304,7 +6304,10 @@ xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc) {
*
* Try to validate the document against the dtd instance
*
- * basically it does check all the definitions in the DtD.
+ * Basically it does check all the definitions in the DtD.
+ * Note the the internal subset (if present) is de-coupled
+ * (i.e. not used), which could give problems if ID or IDREF
+ * is present.
*
* returns 1 if valid or 0 otherwise
*/
@@ -6312,16 +6315,19 @@ xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc) {
int
xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd) {
int ret;
- xmlDtdPtr oldExt;
+ xmlDtdPtr oldExt, oldInt;
xmlNodePtr root;
if (dtd == NULL) return(0);
if (doc == NULL) return(0);
oldExt = doc->extSubset;
+ oldInt = doc->intSubset;
doc->extSubset = dtd;
+ doc->intSubset = NULL;
ret = xmlValidateRoot(ctxt, doc);
if (ret == 0) {
doc->extSubset = oldExt;
+ doc->intSubset = oldInt;
return(ret);
}
if (doc->ids != NULL) {
@@ -6336,6 +6342,7 @@ xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd) {
ret = xmlValidateElement(ctxt, doc, root);
ret &= xmlValidateDocumentFinal(ctxt, doc);
doc->extSubset = oldExt;
+ doc->intSubset = oldInt;
return(ret);
}