diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-02-05 11:01:50 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-02-05 11:01:50 +0000 |
commit | ec498e1b33ffef0246296491642facb95b77a743 (patch) | |
tree | 34b2d392372bc89399b61362ab25098021188183 /valid.c | |
parent | de590ca1805a4691fe217242dd783b9a6b0d19eb (diff) | |
download | android_external_libxml2-ec498e1b33ffef0246296491642facb95b77a743.tar.gz android_external_libxml2-ec498e1b33ffef0246296491642facb95b77a743.tar.bz2 android_external_libxml2-ec498e1b33ffef0246296491642facb95b77a743.zip |
do not run content model validation if the content is not determinist
* valid.c: do not run content model validation if the
content is not determinist
Daniel
Diffstat (limited to 'valid.c')
-rw-r--r-- | valid.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -657,8 +657,13 @@ xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, xmlElementPtr elem) { if (elem->etype != XML_ELEMENT_TYPE_ELEMENT) return(1); /* TODO: should we rebuild in this case ? */ - if (elem->contModel != NULL) + if (elem->contModel != NULL) { + if (!xmlRegexpIsDeterminist(elem->contModel)) { + ctxt->valid = 0; + return(0); + } return(1); + } ctxt->am = xmlNewAutomata(); if (ctxt->am == NULL) { @@ -680,6 +685,10 @@ xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, xmlElementPtr elem) { xmlRegexpPrint(stderr, elem->contModel); #endif ctxt->valid = 0; + ctxt->state = NULL; + xmlFreeAutomata(ctxt->am); + ctxt->am = NULL; + return(0); } ctxt->state = NULL; xmlFreeAutomata(ctxt->am); @@ -4717,6 +4726,9 @@ xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child, } else { xmlRegExecCtxtPtr exec; + if (!xmlRegexpIsDeterminist(elemDecl->contModel)) { + return(-1); + } ctxt->nodeMax = 0; ctxt->nodeNr = 0; ctxt->nodeTab = NULL; |