mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
fixed the error reporting for not transitions fixed output Daniel
* xmlregexp.c xmlschemas.c: fixed the error reporting for not transitions * result/schemas/any5_0_0* result/schemas/any5_0_2* result/schemas/any5_1_0*: fixed output Daniel
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
Tue Jul 19 17:27:26 CEST 2005 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* xmlregexp.c xmlschemas.c: fixed the error reporting for
|
||||||
|
not transitions
|
||||||
|
* result/schemas/any5_0_0* result/schemas/any5_0_2*
|
||||||
|
result/schemas/any5_1_0*: fixed output
|
||||||
|
|
||||||
Tue Jul 19 15:34:12 CEST 2005 Daniel Veillard <daniel@veillard.com>
|
Tue Jul 19 15:34:12 CEST 2005 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* xmlregexp.c xmlschemas.c include/libxml/xmlautomata.h: fixing
|
* xmlregexp.c xmlschemas.c include/libxml/xmlautomata.h: fixing
|
||||||
|
@ -1 +1 @@
|
|||||||
./test/schemas/any5_0.xml:4: element foo: Schemas validity error : Element '{urn:test:foo}foo': Missing child element(s).
|
./test/schemas/any5_0.xml:6: element boo: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected. Expected is ( not {urn:test:foo}* ).
|
||||||
|
@ -1 +1 @@
|
|||||||
./test/schemas/any5_2.xml:4: element foo: Schemas validity error : Element '{urn:test:foo}foo': Missing child element(s).
|
./test/schemas/any5_2.xml:7: element boo: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected.
|
||||||
|
@ -1 +1 @@
|
|||||||
./test/schemas/any5_0.xml:4: element foo: Schemas validity error : Element '{urn:test:foo}foo': Missing child element(s).
|
./test/schemas/any5_0.xml:6: element boo: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected. Expected is ( not {urn:test:foo}* ).
|
||||||
|
23
xmlregexp.c
23
xmlregexp.c
@ -752,6 +752,8 @@ xmlRegFreeAtom(xmlRegAtomPtr atom) {
|
|||||||
xmlFree(atom->ranges);
|
xmlFree(atom->ranges);
|
||||||
if ((atom->type == XML_REGEXP_STRING) && (atom->valuep != NULL))
|
if ((atom->type == XML_REGEXP_STRING) && (atom->valuep != NULL))
|
||||||
xmlFree(atom->valuep);
|
xmlFree(atom->valuep);
|
||||||
|
if ((atom->type == XML_REGEXP_STRING) && (atom->valuep2 != NULL))
|
||||||
|
xmlFree(atom->valuep2);
|
||||||
if ((atom->type == XML_REGEXP_BLOCK_NAME) && (atom->valuep != NULL))
|
if ((atom->type == XML_REGEXP_BLOCK_NAME) && (atom->valuep != NULL))
|
||||||
xmlFree(atom->valuep);
|
xmlFree(atom->valuep);
|
||||||
xmlFree(atom);
|
xmlFree(atom);
|
||||||
@ -3165,7 +3167,7 @@ xmlRegExecPushString2(xmlRegExecCtxtPtr exec, const xmlChar *value,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlRegExecGetalues:
|
* xmlRegExecGetValues:
|
||||||
* @exec: a regexp execution context
|
* @exec: a regexp execution context
|
||||||
* @err: error extraction or normal one
|
* @err: error extraction or normal one
|
||||||
* @nbval: pointer to the number of accepted values IN/OUT
|
* @nbval: pointer to the number of accepted values IN/OUT
|
||||||
@ -3274,14 +3276,20 @@ xmlRegExecGetValues(xmlRegExecCtxtPtr exec, int err,
|
|||||||
count = exec->counts[trans->counter];
|
count = exec->counts[trans->counter];
|
||||||
counter = &exec->comp->counters[trans->counter];
|
counter = &exec->comp->counters[trans->counter];
|
||||||
if (count < counter->max) {
|
if (count < counter->max) {
|
||||||
values[nb++] = (xmlChar *) atom->valuep;
|
if (atom->neg)
|
||||||
|
values[nb++] = (xmlChar *) atom->valuep2;
|
||||||
|
else
|
||||||
|
values[nb++] = (xmlChar *) atom->valuep;
|
||||||
(*nbval)++;
|
(*nbval)++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((exec->comp->states[trans->to] != NULL) &&
|
if ((exec->comp->states[trans->to] != NULL) &&
|
||||||
(exec->comp->states[trans->to]->type !=
|
(exec->comp->states[trans->to]->type !=
|
||||||
XML_REGEXP_SINK_STATE)) {
|
XML_REGEXP_SINK_STATE)) {
|
||||||
values[nb++] = (xmlChar *) atom->valuep;
|
if (atom->neg)
|
||||||
|
values[nb++] = (xmlChar *) atom->valuep2;
|
||||||
|
else
|
||||||
|
values[nb++] = (xmlChar *) atom->valuep;
|
||||||
(*nbval)++;
|
(*nbval)++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3305,7 +3313,10 @@ xmlRegExecGetValues(xmlRegExecCtxtPtr exec, int err,
|
|||||||
if ((exec->comp->states[trans->to] != NULL) &&
|
if ((exec->comp->states[trans->to] != NULL) &&
|
||||||
(exec->comp->states[trans->to]->type ==
|
(exec->comp->states[trans->to]->type ==
|
||||||
XML_REGEXP_SINK_STATE)) {
|
XML_REGEXP_SINK_STATE)) {
|
||||||
values[nb++] = (xmlChar *) atom->valuep;
|
if (atom->neg)
|
||||||
|
values[nb++] = (xmlChar *) atom->valuep2;
|
||||||
|
else
|
||||||
|
values[nb++] = (xmlChar *) atom->valuep;
|
||||||
(*nbneg)++;
|
(*nbneg)++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4766,6 +4777,7 @@ xmlAutomataNewNegTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
|
|||||||
xmlAutomataStatePtr to, const xmlChar *token,
|
xmlAutomataStatePtr to, const xmlChar *token,
|
||||||
const xmlChar *token2, void *data) {
|
const xmlChar *token2, void *data) {
|
||||||
xmlRegAtomPtr atom;
|
xmlRegAtomPtr atom;
|
||||||
|
xmlChar err_msg[200];
|
||||||
|
|
||||||
if ((am == NULL) || (from == NULL) || (token == NULL))
|
if ((am == NULL) || (from == NULL) || (token == NULL))
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@ -4795,6 +4807,9 @@ xmlAutomataNewNegTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
|
|||||||
|
|
||||||
atom->valuep = str;
|
atom->valuep = str;
|
||||||
}
|
}
|
||||||
|
snprintf(err_msg, 199, "not %s", atom->valuep);
|
||||||
|
err_msg[199] = 0;
|
||||||
|
atom->valuep2 = xmlStrdup(err_msg);
|
||||||
|
|
||||||
if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
|
if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
|
||||||
xmlRegFreeAtom(atom);
|
xmlRegFreeAtom(atom);
|
||||||
|
13
xmlschemas.c
13
xmlschemas.c
@ -1879,7 +1879,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
|||||||
xmlChar *str = NULL, *msg = NULL;
|
xmlChar *str = NULL, *msg = NULL;
|
||||||
xmlChar *localName, *nsName;
|
xmlChar *localName, *nsName;
|
||||||
const xmlChar *cur, *end;
|
const xmlChar *cur, *end;
|
||||||
int i;
|
int i, is_not;
|
||||||
|
|
||||||
xmlSchemaFormatNodeForError(&msg, actxt, node);
|
xmlSchemaFormatNodeForError(&msg, actxt, node);
|
||||||
msg = xmlStrcat(msg, (const xmlChar *) message);
|
msg = xmlStrcat(msg, (const xmlChar *) message);
|
||||||
@ -1898,6 +1898,16 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
|||||||
|
|
||||||
for (i = 0; i < nbval + nbneg; i++) {
|
for (i = 0; i < nbval + nbneg; i++) {
|
||||||
cur = values[i];
|
cur = values[i];
|
||||||
|
if (cur == NULL)
|
||||||
|
continue;
|
||||||
|
if ((cur[0] == 'n') && (cur[1] == 'o') && (cur[2] == 't') &&
|
||||||
|
(cur[3] == ' ')) {
|
||||||
|
is_not = 1;
|
||||||
|
cur += 4;
|
||||||
|
str = xmlStrcat(str, BAD_CAST "not ");
|
||||||
|
} else {
|
||||||
|
is_not = 0;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Get the local name.
|
* Get the local name.
|
||||||
*/
|
*/
|
||||||
@ -8679,6 +8689,7 @@ xmlSchemaParseSchemaTopLevel(xmlSchemaParserCtxtPtr ctxt,
|
|||||||
xmlSchemaParseInclude(ctxt, schema, child);
|
xmlSchemaParseInclude(ctxt, schema, child);
|
||||||
ctxt->includes--;
|
ctxt->includes--;
|
||||||
} else if (IS_SCHEMA(child, "redefine")) {
|
} else if (IS_SCHEMA(child, "redefine")) {
|
||||||
|
fprintf(stderr, "redefine is not yet implemented\n");
|
||||||
TODO
|
TODO
|
||||||
}
|
}
|
||||||
child = child->next;
|
child = child->next;
|
||||||
|
Reference in New Issue
Block a user