aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-02-05 11:01:50 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-02-05 11:01:50 +0000
commitec498e1b33ffef0246296491642facb95b77a743 (patch)
tree34b2d392372bc89399b61362ab25098021188183
parentde590ca1805a4691fe217242dd783b9a6b0d19eb (diff)
downloadandroid_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
-rw-r--r--ChangeLog5
-rw-r--r--valid.c14
2 files changed, 18 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e391df45..c984e422 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Feb 5 12:00:36 CET 2003 Daniel Veillard <daniel@veillard.com>
+
+ * valid.c: do not run content model validation if the
+ content is not determinist
+
Wed Feb 5 11:43:58 CET 2003 Daniel Veillard <daniel@veillard.com>
* SAX.c: added the redefinition of namespaced attribute
diff --git a/valid.c b/valid.c
index 0f0fd231..7ed0e8a4 100644
--- a/valid.c
+++ b/valid.c
@@ -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;