made configuring with regexps/automata/unicode the default but without
* Makefile.am configure.in include/libxml/xmlversion.h.in:
made configuring with regexps/automata/unicode the default
but without schemas ATM
* testRegexp.c valid.c xmlregexp.c include/libxml/xmlregexp.h:
fixed the regexp based DTD validation performance and memory
problem by switching to a compact form for determinist regexps
and detecting the determinism property in the process. Seems
as fast as the old DTD validation specific engine :-) despite
the regexp built and compaction process.
Daniel
diff --git a/valid.c b/valid.c
index 5a9a614..fbdc766 100644
--- a/valid.c
+++ b/valid.c
@@ -553,7 +553,7 @@
xmlValidBuildAContentModel(elem->content, ctxt, elem->name);
xmlAutomataSetFinalState(ctxt->am, ctxt->state);
elem->contModel = xmlAutomataCompile(ctxt->am);
- if (!xmlAutomataIsDeterminist(ctxt->am)) {
+ if (!xmlRegexpIsDeterminist(elem->contModel)) {
char expr[5000];
expr[0] = 0;
xmlSnprintfElementContent(expr, 5000, elem->content, 1);
@@ -3849,6 +3849,7 @@
return(child);
}
+#ifndef LIBXML_REGEXP_ENABLED
/**
* xmlValidateElementType:
* @ctxt: the validation context
@@ -4217,6 +4218,7 @@
}
return(determinist);
}
+#endif
/**
* xmlSnprintfElements:
@@ -4319,7 +4321,10 @@
xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child,
xmlElementPtr elemDecl, int warn, xmlNodePtr parent) {
int ret = 1;
- xmlNodePtr repl = NULL, last = NULL, cur, tmp;
+#ifndef LIBXML_REGEXP_ENABLED
+ xmlNodePtr last = NULL;
+#endif
+ xmlNodePtr repl = NULL, cur, tmp;
xmlElementContentPtr cont;
const xmlChar *name;
@@ -4561,7 +4566,9 @@
if (ret == -3)
ret = 1;
+#ifndef LIBXML_REGEXP_ENABLED
done:
+#endif
/*
* Deallocate the copy if done, and free up the validation stack
*/