[LIBXSLT] Update to v1.1.29. CORE-11557
[reactos.git] / reactos / dll / 3rdparty / libxslt / imports.c
index 3d254b7..ac659f0 100644 (file)
@@ -363,17 +363,12 @@ xsltFindTemplate(xsltTransformContextPtr ctxt, const xmlChar *name,
        return(NULL);
     style = ctxt->style;
     while (style != NULL) {
-       cur = style->templates;
-       while (cur != NULL) {
-           if (xmlStrEqual(name, cur->name)) {
-               if (((nameURI == NULL) && (cur->nameURI == NULL)) ||
-                   ((nameURI != NULL) && (cur->nameURI != NULL) &&
-                    (xmlStrEqual(nameURI, cur->nameURI)))) {
-                   return(cur);
-               }
-           }
-           cur = cur->next;
-       }
+        if (style->namedTemplates != NULL) {
+            cur = (xsltTemplatePtr)
+                xmlHashLookup2(style->namedTemplates, name, nameURI);
+            if (cur != NULL)
+                return(cur);
+        }
 
        style = xsltNextImport(style);
     }