cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject REPOST: [PATCH] adding DocumentFragments with <xsp:expr>
Date Wed, 12 Jul 2000 10:45:23 GMT
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


Mime
View raw message