1 19 20 package org.netbeans.modules.xml.xdm.visitor; 21 22 import org.netbeans.modules.xml.xdm.nodes.Document; 23 import org.netbeans.modules.xml.xdm.nodes.Element; 24 import org.netbeans.modules.xml.xdm.nodes.Node; 25 import org.w3c.dom.NodeList ; 26 import org.w3c.dom.NamedNodeMap ; 27 28 32 public class ChildVisitor extends DefaultVisitor { 33 34 protected void visitNode(Node container) { 35 NodeList children = container.getChildNodes(); 36 for (int i =0; i<children.getLength(); i++) { 37 Node l = (Node)children.item(i); 38 l.accept(this); 39 } 40 NamedNodeMap attributes = container.getAttributes(); 41 for (int i =0; i<attributes.getLength(); i++) { 42 Node l = (Node)attributes.item(i); 43 l.accept(this); 44 } 45 } 46 } 47 | Popular Tags |