--- /home/cpdev/src/classpath/gnu/xml/transform/CallTemplateNode.java	2006-01-13 17:32:47.000000000 +0000
+++ gnu/xml/transform/CallTemplateNode.java	2005-09-14 21:51:32.000000000 +0000
@@ -1,5 +1,5 @@
 /* CallTemplateNode.java -- 
-   Copyright (C) 2004,2006 Free Software Foundation, Inc.
+   Copyright (C) 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -69,12 +69,18 @@
     int len = withParams.size();
     List withParams2 = new ArrayList(len);
     for (int i = 0; i < len; i++)
-      withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet));
+      {
+        withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet));
+      }
     TemplateNode ret = new CallTemplateNode(name, withParams2);
     if (children != null)
-      ret.children = children.clone(stylesheet);
+      {
+        ret.children = children.clone(stylesheet);
+      }
     if (next != null)
-      ret.next = next.clone(stylesheet);
+      {
+        ret.next = next.clone(stylesheet);
+      }
     return ret;
   }
 
@@ -83,52 +89,52 @@
                Node parent, Node nextSibling)
     throws TransformerException
   {
-    TemplateNode t = stylesheet.getTemplate(mode, name);
-    if (t != null)
+    if (withParams != null)
       {
-        if (withParams != null)
+        // compute the parameter values
+        LinkedList values = new LinkedList();
+        for (Iterator i = withParams.iterator(); i.hasNext(); )
           {
-            // compute the parameter values
-            LinkedList values = new LinkedList();
-            for (Iterator i = withParams.iterator(); i.hasNext(); )
-              {
-                WithParam p = (WithParam) i.next();
-                if (t.hasParam(p.name)) // ignore parameters not specified
-                  {
-                    Object value = p.getValue(stylesheet, mode, context,
-                                              pos, len);
-                    Object[] pair = new Object[2];
-                    pair[0] = p.name;
-                    pair[1] = value;
-                    values.add(pair);
-                  }
-              }
-            // push the parameter context
-            stylesheet.bindings.push(Bindings.WITH_PARAM);
-            // set the parameters
-            for (Iterator i = values.iterator(); i.hasNext(); )
+            WithParam p = (WithParam) i.next();
+            Object value = p.getValue(stylesheet, mode, context, pos, len);
+            Object[] pair = new Object[2];
+            pair[0] = p.name;
+            pair[1] = value;
+            values.add(pair);
+          }
+        // push the parameter context
+        stylesheet.bindings.push(Bindings.WITH_PARAM);
+        // set the parameters
+        for (Iterator i = values.iterator(); i.hasNext(); )
+          {
+            Object[] pair = (Object[]) i.next();
+            QName name = (QName) pair[0];
+            Object value = pair[1];
+            stylesheet.bindings.set(name, value, Bindings.WITH_PARAM);
+            if (stylesheet.debug)
               {
-                Object[] pair = (Object[]) i.next();
-                QName name = (QName) pair[0];
-                Object value = pair[1];
-                stylesheet.bindings.set(name, value, Bindings.WITH_PARAM);
-                if (stylesheet.debug)
-                  System.err.println("with-param: " + name + " = " + value);
+                System.err.println("with-param: " + name + " = " + value);
               }
           }
+      }
+    TemplateNode t = stylesheet.getTemplate(mode, name);
+    if (t != null)
+      {
         t.apply(stylesheet, mode, context, pos, len,
                 parent, nextSibling);
-        if (withParams != null)
-          {
-            // pop the variable context
-            stylesheet.bindings.pop(Bindings.WITH_PARAM);
-          }
+      }
+    if (withParams != null)
+      {
+        // pop the variable context
+        stylesheet.bindings.pop(Bindings.WITH_PARAM);
       }
     // call-template doesn't have processable children
     if (next != null)
+      {
         next.apply(stylesheet, mode,
                    context, pos, len,
                    parent, nextSibling);
+      }
   }
   
   public boolean references(QName var)
@@ -138,7 +144,9 @@
         for (Iterator i = withParams.iterator(); i.hasNext(); )
           {
             if (((WithParam) i.next()).references(var))
-              return true;
+              {
+                return true;
+              }
           }
       }
     return super.references(var);
@@ -146,7 +154,7 @@
   
   public String toString()
   {
-    StringBuffer buf = new StringBuffer("call-template");
+    StringBuffer buf = new StringBuffer(getClass().getName());
     buf.append('[');
     buf.append("name=");
     buf.append(name);
