if (type)
{
size_t len;
- const char *eq = strchr(s, '~');
- if (eq)
- len = eq - s;
+ int substring;
+ const char *eq;
+
+ if ((eq = strchr(s, '=')))
+ substring = 0;
+ else if ((eq = strchr(s, '~')))
+ substring = 1;
+ if (eq)
+ len = eq - s;
else
len = strlen(s);
if (len == strlen((const char *)type) &&
xmlChar *value = xmlNodeGetContent(n);
if (value && *value)
{
- if (!eq || strstr((const char *) value, eq+1))
+ if (!eq ||
+ (substring && strstr((const char *) value, eq+1)) ||
+ (!substring && !strcmp((const char *) value, eq + 1)))
match = 1;
}
xmlFree(value);