diff options
author | William M. Brack <wbrack@src.gnome.org> | 2004-10-23 18:14:36 +0000 |
---|---|---|
committer | William M. Brack <wbrack@src.gnome.org> | 2004-10-23 18:14:36 +0000 |
commit | 367df6e7e1798a55820d96ca0ee070b638b26d29 (patch) | |
tree | fd31d5c4cc729b32fe32ad4348cc0f47c471e079 /valid.c | |
parent | fc484dd0a01b5f8f2187dd8a6791d5f8677fa816 (diff) | |
download | libxml2-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.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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); } |