mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
trying to nail down the remaining ##other issues completed the tests and
* xmlregexp.c xmlschemas.c: trying to nail down the remaining ##other issues * result/schemas/any7* test/schemas/any7: completed the tests and added the results * result/schemas/any3_0_0.err result/schemas/any5_0_0.err result/schemas/any5_1_0.err: this slightly chnages the output from 3 existing tests Daniel
This commit is contained in:
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
Tue Aug 9 13:07:27 CEST 2005 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* xmlregexp.c xmlschemas.c: trying to nail down the remaining
|
||||||
|
##other issues
|
||||||
|
* result/schemas/any7* test/schemas/any7: completed the tests
|
||||||
|
and added the results
|
||||||
|
* result/schemas/any3_0_0.err result/schemas/any5_0_0.err
|
||||||
|
result/schemas/any5_1_0.err: this slightly chnages the output
|
||||||
|
from 3 existing tests
|
||||||
|
|
||||||
Mon Aug 8 22:33:08 CEST 2005 Daniel Veillard <daniel@veillard.com>
|
Mon Aug 8 22:33:08 CEST 2005 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* nanoftp.c nanohttp.c xmlschemastypes.c: applied patch from
|
* nanoftp.c nanohttp.c xmlschemastypes.c: applied patch from
|
||||||
|
@ -1 +1 @@
|
|||||||
./test/schemas/any3_0.xml:12: element bar.A: Schemas validity error : Element 'bar.A': This element is not expected. Expected is one of ( {##other:http://FOO}* ).
|
./test/schemas/any3_0.xml:12: element bar.A: Schemas validity error : Element 'bar.A': This element is not expected. Expected is ( ##other{http://FOO}* ).
|
||||||
|
@ -1 +1 @@
|
|||||||
./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}* ).
|
./test/schemas/any5_0.xml:6: element boo: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
|
||||||
|
@ -1 +1 @@
|
|||||||
./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}* ).
|
./test/schemas/any5_0.xml:6: element boo: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
|
||||||
|
1
result/schemas/any7_1_0
Normal file
1
result/schemas/any7_1_0
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/schemas/any7_0.xml fails to validate
|
1
result/schemas/any7_1_0.err
Normal file
1
result/schemas/any7_1_0.err
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/schemas/any7_0.xml:18: element moo: Schemas validity error : Element 'moo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
|
1
result/schemas/any7_1_1
Normal file
1
result/schemas/any7_1_1
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/schemas/any7_1.xml fails to validate
|
1
result/schemas/any7_1_1.err
Normal file
1
result/schemas/any7_1_1.err
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/schemas/any7_1.xml:17: element bar: Schemas validity error : Element '{urn:test:foo}bar': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
|
1
result/schemas/any7_2_0
Normal file
1
result/schemas/any7_2_0
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/schemas/any7_0.xml fails to validate
|
1
result/schemas/any7_2_0.err
Normal file
1
result/schemas/any7_2_0.err
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/schemas/any7_0.xml:18: element moo: Schemas validity error : Element 'moo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
|
1
result/schemas/any7_2_1
Normal file
1
result/schemas/any7_2_1
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/schemas/any7_1.xml fails to validate
|
1
result/schemas/any7_2_1.err
Normal file
1
result/schemas/any7_2_1.err
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/schemas/any7_1.xml:17: element bar: Schemas validity error : Element '{urn:test:foo}bar': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
|
13
test/schemas/any7_2.xsd
Executable file
13
test/schemas/any7_2.xsd
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
targetNamespace="urn:test:foo"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
<xs:element name="foo">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="bar"/>
|
||||||
|
<xs:any namespace="##other" processContents="lax" maxOccurs="2"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
42
xmlregexp.c
42
xmlregexp.c
@ -246,6 +246,7 @@ struct _xmlAutomata {
|
|||||||
xmlRegCounter *counters;
|
xmlRegCounter *counters;
|
||||||
|
|
||||||
int determinist;
|
int determinist;
|
||||||
|
int negs;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _xmlRegexp {
|
struct _xmlRegexp {
|
||||||
@ -419,6 +420,7 @@ xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) {
|
|||||||
|
|
||||||
if ((ret->determinist != 0) &&
|
if ((ret->determinist != 0) &&
|
||||||
(ret->nbCounters == 0) &&
|
(ret->nbCounters == 0) &&
|
||||||
|
(ctxt->negs == 0) &&
|
||||||
(ret->atoms != NULL) &&
|
(ret->atoms != NULL) &&
|
||||||
(ret->atoms[0] != NULL) &&
|
(ret->atoms[0] != NULL) &&
|
||||||
(ret->atoms[0]->type == XML_REGEXP_STRING)) {
|
(ret->atoms[0]->type == XML_REGEXP_STRING)) {
|
||||||
@ -661,6 +663,7 @@ xmlRegNewParserCtxt(const xmlChar *string) {
|
|||||||
ret->string = xmlStrdup(string);
|
ret->string = xmlStrdup(string);
|
||||||
ret->cur = ret->string;
|
ret->cur = ret->string;
|
||||||
ret->neg = 0;
|
ret->neg = 0;
|
||||||
|
ret->negs = 0;
|
||||||
ret->error = 0;
|
ret->error = 0;
|
||||||
ret->determinist = -1;
|
ret->determinist = -1;
|
||||||
return(ret);
|
return(ret);
|
||||||
@ -1902,8 +1905,9 @@ xmlFACompareAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2) {
|
|||||||
default:
|
default:
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
if (atom1->neg != atom2->neg)
|
if (atom1->neg != atom2->neg) {
|
||||||
ret = !ret;
|
ret = !ret;
|
||||||
|
}
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2903,19 +2907,20 @@ error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlRegExecPushString:
|
* xmlRegExecPushStringInternal:
|
||||||
* @exec: a regexp execution context or NULL to indicate the end
|
* @exec: a regexp execution context or NULL to indicate the end
|
||||||
* @value: a string token input
|
* @value: a string token input
|
||||||
* @data: data associated to the token to reuse in callbacks
|
* @data: data associated to the token to reuse in callbacks
|
||||||
|
* @compound: value was assembled from 2 strings
|
||||||
*
|
*
|
||||||
* Push one input token in the execution context
|
* Push one input token in the execution context
|
||||||
*
|
*
|
||||||
* Returns: 1 if the regexp reached a final state, 0 if non-final, and
|
* Returns: 1 if the regexp reached a final state, 0 if non-final, and
|
||||||
* a negative value in case of error.
|
* a negative value in case of error.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
xmlRegExecPushString(xmlRegExecCtxtPtr exec, const xmlChar *value,
|
xmlRegExecPushStringInternal(xmlRegExecCtxtPtr exec, const xmlChar *value,
|
||||||
void *data) {
|
void *data, int compound) {
|
||||||
xmlRegTransPtr trans;
|
xmlRegTransPtr trans;
|
||||||
xmlRegAtomPtr atom;
|
xmlRegAtomPtr atom;
|
||||||
int ret;
|
int ret;
|
||||||
@ -3057,8 +3062,11 @@ xmlRegExecPushString(xmlRegExecCtxtPtr exec, const xmlChar *value,
|
|||||||
break;
|
break;
|
||||||
} else if (value != NULL) {
|
} else if (value != NULL) {
|
||||||
ret = xmlRegStrEqualWildcard(atom->valuep, value);
|
ret = xmlRegStrEqualWildcard(atom->valuep, value);
|
||||||
if (atom->neg)
|
if (atom->neg) {
|
||||||
ret = !ret;
|
ret = !ret;
|
||||||
|
if (!compound)
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
if ((ret == 1) && (trans->counter >= 0)) {
|
if ((ret == 1) && (trans->counter >= 0)) {
|
||||||
xmlRegCounterPtr counter;
|
xmlRegCounterPtr counter;
|
||||||
int count;
|
int count;
|
||||||
@ -3257,6 +3265,23 @@ progress:
|
|||||||
return(exec->status);
|
return(exec->status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xmlRegExecPushString:
|
||||||
|
* @exec: a regexp execution context or NULL to indicate the end
|
||||||
|
* @value: a string token input
|
||||||
|
* @data: data associated to the token to reuse in callbacks
|
||||||
|
*
|
||||||
|
* Push one input token in the execution context
|
||||||
|
*
|
||||||
|
* Returns: 1 if the regexp reached a final state, 0 if non-final, and
|
||||||
|
* a negative value in case of error.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
xmlRegExecPushString(xmlRegExecCtxtPtr exec, const xmlChar *value,
|
||||||
|
void *data) {
|
||||||
|
return(xmlRegExecPushStringInternal(exec, value, data, 0));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlRegExecPushString2:
|
* xmlRegExecPushString2:
|
||||||
* @exec: a regexp execution context or NULL to indicate the end
|
* @exec: a regexp execution context or NULL to indicate the end
|
||||||
@ -3306,7 +3331,7 @@ xmlRegExecPushString2(xmlRegExecCtxtPtr exec, const xmlChar *value,
|
|||||||
if (exec->comp->compact != NULL)
|
if (exec->comp->compact != NULL)
|
||||||
ret = xmlRegCompactPushString(exec, exec->comp, str, data);
|
ret = xmlRegCompactPushString(exec, exec->comp, str, data);
|
||||||
else
|
else
|
||||||
ret = xmlRegExecPushString(exec, str, data);
|
ret = xmlRegExecPushStringInternal(exec, str, data, 1);
|
||||||
|
|
||||||
if (str != buf)
|
if (str != buf)
|
||||||
xmlFree(buf);
|
xmlFree(buf);
|
||||||
@ -4917,6 +4942,8 @@ xmlAutomataNewTransition2(xmlAutomataPtr am, xmlAutomataStatePtr from,
|
|||||||
* If @to is NULL, this creates first a new target state in the automata
|
* If @to is NULL, this creates first a new target state in the automata
|
||||||
* and then adds a transition from the @from state to the target state
|
* and then adds a transition from the @from state to the target state
|
||||||
* activated by any value except (@token,@token2)
|
* activated by any value except (@token,@token2)
|
||||||
|
* Note that if @token2 is not NULL, then (X, NULL) won't match to follow
|
||||||
|
# the semantic of XSD ##other
|
||||||
*
|
*
|
||||||
* Returns the target state or NULL in case of error
|
* Returns the target state or NULL in case of error
|
||||||
*/
|
*/
|
||||||
@ -4963,6 +4990,7 @@ xmlAutomataNewNegTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
|
|||||||
xmlRegFreeAtom(atom);
|
xmlRegFreeAtom(atom);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
am->negs++;
|
||||||
if (to == NULL)
|
if (to == NULL)
|
||||||
return(am->state);
|
return(am->state);
|
||||||
return(to);
|
return(to);
|
||||||
|
19
xmlschemas.c
19
xmlschemas.c
@ -1935,7 +1935,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
|||||||
(cur[3] == ' ')) {
|
(cur[3] == ' ')) {
|
||||||
is_not = 1;
|
is_not = 1;
|
||||||
cur += 4;
|
cur += 4;
|
||||||
str = xmlStrcat(str, BAD_CAST "not ");
|
str = xmlStrcat(str, BAD_CAST "##other");
|
||||||
} else {
|
} else {
|
||||||
is_not = 0;
|
is_not = 0;
|
||||||
}
|
}
|
||||||
@ -11137,20 +11137,9 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt,
|
|||||||
} while (ns != NULL);
|
} while (ns != NULL);
|
||||||
|
|
||||||
} else if (wild->negNsSet != NULL) {
|
} else if (wild->negNsSet != NULL) {
|
||||||
|
pctxt->state = xmlAutomataNewNegTrans(pctxt->am,
|
||||||
/*
|
start, end, BAD_CAST "*", wild->negNsSet->value,
|
||||||
* Lead nodes with the negated namespace to the sink-state
|
wild);
|
||||||
* {"*", "##other"}.
|
|
||||||
*/
|
|
||||||
pctxt->state = xmlAutomataNewTransition2(pctxt->am, start, NULL,
|
|
||||||
BAD_CAST "*", wild->negNsSet->value, wild);
|
|
||||||
/*
|
|
||||||
* Open a door for nodes with any other namespace
|
|
||||||
* {"*", "*"}
|
|
||||||
*/
|
|
||||||
pctxt->state = xmlAutomataNewTransition2(pctxt->am,
|
|
||||||
start, NULL, BAD_CAST "*", BAD_CAST "*", wild);
|
|
||||||
xmlAutomataNewEpsilon(pctxt->am, pctxt->state, end);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int counter;
|
int counter;
|
||||||
|
Reference in New Issue
Block a user