mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
Fix regression in RelaxNG pattern matching
XML_SCHEMAS_QNAME is not a string-derived type. Other types up to XML_SCHEMAS_ENTITIES are. Should fix #224.
This commit is contained in:
parent
d54564ea00
commit
daf2d9c3de
@ -5431,7 +5431,6 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet,
|
||||
xmlSchemaWhitespaceValueType ws)
|
||||
{
|
||||
int ret;
|
||||
int stringType;
|
||||
|
||||
if (facet == NULL)
|
||||
return(-1);
|
||||
@ -5449,10 +5448,16 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet,
|
||||
* the datatype.
|
||||
* See https://www.w3.org/TR/xmlschema-2/#rf-pattern
|
||||
*/
|
||||
stringType = val && ((val->type >= XML_SCHEMAS_STRING && val->type <= XML_SCHEMAS_NORMSTRING)
|
||||
|| (val->type >= XML_SCHEMAS_TOKEN && val->type <= XML_SCHEMAS_NCNAME));
|
||||
ret = xmlRegexpExec(facet->regexp,
|
||||
(stringType && val->value.str) ? val->value.str : value);
|
||||
if (val &&
|
||||
val->value.str &&
|
||||
((val->type >= XML_SCHEMAS_STRING &&
|
||||
val->type <= XML_SCHEMAS_NORMSTRING) ||
|
||||
(val->type >= XML_SCHEMAS_TOKEN &&
|
||||
val->type <= XML_SCHEMAS_ENTITIES &&
|
||||
val->type != XML_SCHEMAS_QNAME))) {
|
||||
value = val->value.str;
|
||||
}
|
||||
ret = xmlRegexpExec(facet->regexp, value);
|
||||
if (ret == 1)
|
||||
return(0);
|
||||
if (ret == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user