bodewig 02/03/25 01:23:10
Modified: proposal/gump/java Jenny.java
Log:
Don't blindly assume that the first node of a document is an element
instance - xml-forrest has a PI there for example.
Revision Changes Path
1.16 +10 -1 jakarta-alexandria/proposal/gump/java/Jenny.java
Index: Jenny.java
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/java/Jenny.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Jenny.java 20 Mar 2002 12:42:37 -0000 1.15
+++ Jenny.java 25 Mar 2002 09:23:10 -0000 1.16
@@ -120,7 +120,16 @@
node.setAttribute("defined-in", source);
Document doc = node.getOwnerDocument();
- Element copy=(Element)doc.importNode(sub.getFirstChild(), true);
+ Element copy = null;
+ Node first = sub.getFirstChild();
+ for (Node child=first; child!=null;
+ child=child.getNextSibling()) {
+ if (child.getNodeType() == Node.ELEMENT_NODE) {
+ copy = (Element)doc.importNode(child, true);
+ break;
+ }
+ }
+
moveChildren(node, copy);
node.getParentNode().replaceChild(copy,node);
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>