Demos and Usage of org.w3c.dom.Node.getChildNodes()


   1: {
   2:     public static void map (Node elm, String str) {
   3:         ...
   4:     NodeList nodes = elm.getChildNodes();
   5:     for (int i = 0 ; i < nodes.getLength(); i++) {
   6:         ...
   7:         Node node = nodes.item(i);
   8:         if (node instanceof Text) {

View Full Code Here
   1: 
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5:     public interface NodeVisitor {
   6:         void accept(Node n);
   7:     }
   8:         ...
   9: 
  10:     public void recursiveVisit(Node n, boolean parentFirst ) {
  11:         if ( n == null ) return;
  12:         ...
  13:         nodeCount++;
  14:         NodeList nl = n.getChildNodes();

View Full Code Here
   1: 
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5:     public interface NodeVisitor {
   6:     public void recursiveVisit(Node n ) {
   7:         if ( n == null ) return;
   8:         ...
   9:         visitor_.preVisit(n);
  10:         NodeList nl = n.getChildNodes();
  11:         for ( int i=0; i<nl.getLength(); i++ ) {

View Full Code Here
   1: 
   2:     public List(Node node, String prefix, PersistentClass owner, Root root) throws MappingException {
   3:         ...
   4:         super(node, prefix, owner, root);
   5:     }
   6:         ...
   7:         if (doneSecondPass) return;
   8:         NodeList list = node.getChildNodes();
   9:         for ( int i=0; i<list.getLength(); i++ ) {

View Full Code Here
   1: import org.w3c.dom.NamedNodeMap;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5: {
   6:     public static Node getChild(Node node, String name)
   7:     {
   8:         ...
   9:         NodeList childs = node.getChildNodes();

View Full Code Here
   1: import org.springmodules.validation.util.collection.ReadOnlyIterator;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5: 
   6:     public ChildNodesIterator(Node node) {
   7:         ...
   8:         nodes = node.getChildNodes();
   9:         length = nodes.getLength();

View Full Code Here
   1: import java.util.Collections;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5: public class Nodes {
   6:     public static final String valueOf(Node node) {
   7:         if (node instanceof Item) {
   8:         ...
   9:             StringBuffer sb = new StringBuffer();
  10:             NodeList nl = node.getChildNodes();
  11:             Node child;

View Full Code Here
   1: import org.cougaar.planning.ldm.plan.Verb;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5: 
   6:   public Verb getVerb(Node node){
   7:         ...
   8:     NodeList  nlist    = node.getChildNodes();      
   9:     int       nlength  = nlist.getLength();

View Full Code Here
   1: 
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5: 
   6:   protected static Map getElements(Node snipNode) {
   7:         ...
   8:     NodeList children = snipNode.getChildNodes();
   9:     Map elements = new HashMap();
  10:         ...
  11:     for (int i = 0; i < children.getLength(); i++) {
  12:       Node node = children.item(i);

View Full Code Here
   1: 
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5: 
   6:   public void setDOMObject(Object node) {
   7:         ...
   8:     if (!(node instanceof Node)) return;
   9:     Node xmlNode=(Node)node;
  10:         ...
  11:     properties=new ArrayList();
  12:     NodeList nodeList=xmlNode.getChildNodes();

View Full Code Here
   1: import cirrus.hibernate.*;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5: 
   6:     public Array(Node node, String prefix, PersistentClass owner, Root root) throws MappingException {
   7:         super(node, prefix, owner, root);
   8:         ...
   9:             
  10:             NodeList list = node.getChildNodes();
  11:             for ( int i=0; i<list.getLength(); i++ ) {

View Full Code Here
   1: import org.w3c.dom.NodeList;
   2: import org.w3c.dom.Node;
   3: 
   4:         ...
   5: public class FunctionDescriptor {
   6:     Node node;
   7:     public FunctionDescriptor(Node n){
   8:         ...
   9:     public String getFunctionClass(){
  10:         NodeList n1 = node.getChildNodes();
  11:         int i = 0;
  12:         ...
  13:     public String getFunctionSignature() {
  14:         NodeList n1 = node.getChildNodes();

View Full Code Here
   1: import com.meterware.httpunit.WebResponse;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5:         WebForm form = response.getFormWithID("testForm");
   6:         Node node = form.getDOMSubtree();
   7:         ...
   8:         NodeList lst = node.getChildNodes();
   9:         assertTrue(2 <= lst.getLength());

View Full Code Here
   1: import org.w3c.dom.Document;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5:   private void buildModel() {
   6:     insertChildren((DefaultMutableTreeNode)this.getRoot(),document.getChildNodes().item(0));
   7:     this.nodesWereInserted((DefaultMutableTreeNode)this.getRoot(),new int[]{0});
   8:         ...
   9: 
  10:   private void insertChildren (DefaultMutableTreeNode treeNode, Node domNode) {
  11:       DefaultMutableTreeNode child=factory.buildTreeNode(domNode);
  12:         ...
  13:       nodesWereInserted(treeNode,new int[]{treeNode.getChildCount()-1});
  14:       NodeList nodeList=domNode.getChildNodes();

View Full Code Here
   1: import org.w3c.dom.NamedNodeMap;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5: 
   6:   private void traverse(Node node) {
   7:     traverse(node, node);
   8:         ...
   9:       case Node.ELEMENT_NODE: {
  10:         NodeList children = node.getChildNodes();
  11:         if (children != null) {
  12:         ...
  13:       case Node.ENTITY_REFERENCE_NODE: {
  14:         NodeList children = node.getChildNodes();

View Full Code Here