mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00: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:
parent
de590ca180
commit
ec498e1b33
@ -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
|
||||
|
14
valid.c
14
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user