mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
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
This commit is contained in:
@ -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>
|
Wed Feb 5 11:43:58 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* SAX.c: added the redefinition of namespaced attribute
|
* SAX.c: added the redefinition of namespaced attribute
|
||||||
|
14
valid.c
14
valid.c
@ -657,8 +657,13 @@ xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, xmlElementPtr elem) {
|
|||||||
if (elem->etype != XML_ELEMENT_TYPE_ELEMENT)
|
if (elem->etype != XML_ELEMENT_TYPE_ELEMENT)
|
||||||
return(1);
|
return(1);
|
||||||
/* TODO: should we rebuild in this case ? */
|
/* 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);
|
return(1);
|
||||||
|
}
|
||||||
|
|
||||||
ctxt->am = xmlNewAutomata();
|
ctxt->am = xmlNewAutomata();
|
||||||
if (ctxt->am == NULL) {
|
if (ctxt->am == NULL) {
|
||||||
@ -680,6 +685,10 @@ xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, xmlElementPtr elem) {
|
|||||||
xmlRegexpPrint(stderr, elem->contModel);
|
xmlRegexpPrint(stderr, elem->contModel);
|
||||||
#endif
|
#endif
|
||||||
ctxt->valid = 0;
|
ctxt->valid = 0;
|
||||||
|
ctxt->state = NULL;
|
||||||
|
xmlFreeAutomata(ctxt->am);
|
||||||
|
ctxt->am = NULL;
|
||||||
|
return(0);
|
||||||
}
|
}
|
||||||
ctxt->state = NULL;
|
ctxt->state = NULL;
|
||||||
xmlFreeAutomata(ctxt->am);
|
xmlFreeAutomata(ctxt->am);
|
||||||
@ -4717,6 +4726,9 @@ xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child,
|
|||||||
} else {
|
} else {
|
||||||
xmlRegExecCtxtPtr exec;
|
xmlRegExecCtxtPtr exec;
|
||||||
|
|
||||||
|
if (!xmlRegexpIsDeterminist(elemDecl->contModel)) {
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
ctxt->nodeMax = 0;
|
ctxt->nodeMax = 0;
|
||||||
ctxt->nodeNr = 0;
|
ctxt->nodeNr = 0;
|
||||||
ctxt->nodeTab = NULL;
|
ctxt->nodeTab = NULL;
|
||||||
|
Reference in New Issue
Block a user