Commit e8c9cd5c authored by Nick Wellnhofer's avatar Nick Wellnhofer

Fix Schema determinism check of ##other namespaces

Non-compound (##local) and compound string atoms are always disjoint
regardless of whether the compound atom is negated (##other).

Closes #40.
parent 4e326a3a
./test/schemas/issue40_0.xml validates
<a:aaa xmlns:a="aaa_ns">
<x/>
</a:aaa>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="aaa_ns" xmlns="http://www.w3.org/1999/XSL/Transform">
<xsd:element name="aaa">
<xsd:complexType>
<xsd:choice>
<xsd:any namespace="##other" processContents="skip" />
<xsd:any namespace="##local" processContents="skip" />
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
......@@ -2528,9 +2528,18 @@ xmlFACompareAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
case XML_REGEXP_STRING:
if (!deep)
ret = (atom1->valuep != atom2->valuep);
else
ret = xmlRegStrEqualWildcard((xmlChar *)atom1->valuep,
(xmlChar *)atom2->valuep);
else {
xmlChar *val1 = (xmlChar *)atom1->valuep;
xmlChar *val2 = (xmlChar *)atom2->valuep;
int compound1 = (xmlStrchr(val1, '|') != NULL);
int compound2 = (xmlStrchr(val2, '|') != NULL);
/* Ignore negative match flag for ##other namespaces */
if (compound1 != compound2)
return(0);
ret = xmlRegStrEqualWildcard(val1, val2);
}
break;
case XML_REGEXP_EPSILON:
goto not_determinist;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment