--- /home/cpdev/src/classpath/gnu/xml/transform/ValueOfNode.java	2005-07-10 05:32:35.000000000 +0000
+++ gnu/xml/transform/ValueOfNode.java	2005-06-30 05:34:22.000000000 +0000
@@ -37,8 +37,6 @@
 
 package gnu.xml.transform;
 
-import java.util.Collection;
-import java.util.Iterator;
 import javax.xml.namespace.QName;
 import javax.xml.transform.TransformerException;
 import org.w3c.dom.Document;
@@ -58,25 +56,22 @@
   final Expr select;
   final boolean disableOutputEscaping;
 
-  ValueOfNode(Expr select, boolean disableOutputEscaping)
+  ValueOfNode(TemplateNode children, TemplateNode next, Expr select,
+              boolean disableOutputEscaping)
   {
+    super(children, next);
     this.select = select;
     this.disableOutputEscaping = disableOutputEscaping;
   }
 
   TemplateNode clone(Stylesheet stylesheet)
   {
-    TemplateNode ret = new ValueOfNode(select.clone(stylesheet),
-                                       disableOutputEscaping);
-    if (children != null)
-      {
-        ret.children = children.clone(stylesheet);
-      }
-    if (next != null)
-      {
-        ret.next = next.clone(stylesheet);
-      }
-    return ret;
+    return new ValueOfNode((children == null) ? null :
+                           children.clone(stylesheet),
+                           (next == null) ? null :
+                           next.clone(stylesheet),
+                           select.clone(stylesheet),
+                           disableOutputEscaping);
   }
 
   void doApply(Stylesheet stylesheet, QName mode,
@@ -85,29 +80,8 @@
     throws TransformerException
   {
     Object ret = select.evaluate(context, pos, len);
-    /*if (stylesheet.debug)
-      {
-        System.err.println("value-of: " + select + " -> " + ret);
-      }*/
-    String value;
-    if (ret instanceof Collection)
-      {
-        StringBuffer buf = new StringBuffer();
-        for (Iterator i = ((Collection) ret).iterator(); i.hasNext(); )
-          {
-            Node node = (Node) i.next();
-            buf.append(Expr.stringValue(node));
-          }
-        value = buf.toString();
-      }
-    else
-      {
-        value = Expr._string(context, ret);
-      }
-    if (stylesheet.debug)
-      {
-        System.err.println("value-of: "+context+" "+ select + " -> "+ value);
-      }
+    String value = Expr._string(context, ret);
+    //System.err.println("value-of: "+context+" "+ select + " -> "+ value);
     if (value != null && value.length() > 0)
       {
         Document doc = (parent instanceof Document) ?
@@ -135,15 +109,6 @@
       }
   }
 
-  public boolean references(QName var)
-  {
-    if (select != null && select.references(var))
-      {
-        return true;
-      }
-    return super.references(var);
-  }
-  
   public String toString()
   {
     StringBuffer buf = new StringBuffer(getClass().getName());
