You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Robin Green <gr...@hotmail.com> on 2000/07/04 14:33:40 UTC

[PATCH] for 1.7.4 - adding DocumentFragments using

This patch fixes the bug that <xsp:expr> does not accept DocumentFragments.

--- XSPUtil.java	Tue Jul  4 12:20:50 2000
+++ XSPUtil.new	Thu Jun 22 19:23:10 2000
@@ -212,6 +212,19 @@
       case Node.TEXT_NODE: {
         return factory.createTextNode(node.getNodeValue());
       }
+      case Node.DOCUMENT_FRAGMENT_NODE: {
+        DocumentFragment input = (DocumentFragment) node;
+        DocumentFragment output = factory.createDocumentFragment();
+
+        NodeList nodeList = input.getChildNodes();
+        int childCount = nodeList.getLength();
+        for (int i = 0; i < childCount; i++) {
+          Node child = cloneNode(nodeList.item(i), factory);
+          if (child != null) output.appendChild(child);
+        }
+
+        return output;
+      }
       default:
         return null;
     }


________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com