Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 86052 invoked from network); 4 Jul 2000 11:34:10 -0000 Received: from f234.law4.hotmail.com (HELO hotmail.com) (216.33.149.234) by locus.apache.org with SMTP; 4 Jul 2000 11:34:10 -0000 Received: (qmail 50034 invoked by uid 0); 4 Jul 2000 11:33:41 -0000 Message-ID: <20000704113341.50033.qmail@hotmail.com> Received: from 212.41.50.188 by www.hotmail.com with HTTP; Tue, 04 Jul 2000 04:33:40 PDT X-Originating-IP: [212.41.50.188] From: "Robin Green" To: cocoon-dev@xml.apache.org Subject: [PATCH] for 1.7.4 - adding DocumentFragments using Date: Tue, 04 Jul 2000 12:33:40 BST Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This patch fixes the bug that 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