+#if HAVE_XSLT
+int Yaz_ProxyConfig::check_esn(xmlNodePtr ptr, Z_RecordComposition *comp)
+{
+ char *esn = 0;
+ int default_match = 1;
+ if (comp && comp->which == Z_RecordComp_simple &&
+ comp->u.simple && comp->u.simple->which == Z_ElementSetNames_generic)
+ {
+ esn = comp->u.simple->u.generic;
+ }
+ if (!esn)
+ return 1;
+ for (; ptr; ptr = ptr->next)
+ {
+ if (ptr->type == XML_TEXT_NODE)
+ {
+ default_match = 0;
+ xmlChar *t = ptr->content;
+ while (*t)
+ {
+ while (*t && isspace(*t))
+ t++;
+ xmlChar *s = t;
+ int i = 0;
+ while (esn[i] && esn[i] == *s)
+ {
+ i++;
+ s++;
+ }
+ if (!esn[i] && (!*s || isspace(*s)))
+ return 1;
+ while (*s && !isspace(*s))
+ s++;
+ t = s;
+ }
+ }
+ }
+ return default_match;
+}
+#endif
+