Traversing an Entire Document - Using Recursion (3)


Handling Document Nodes:
   public static void display_names(Node node)
   {
      if(node == null) {
	 return;
      }
      int type = node.getNodeType();
      switch (type) {
         case Node.DOCUMENT_NODE: {
            display_names(((Document)node).getDocumentElement());
	    break;
         }
         case Node.ELEMENT_NODE: {
            .
            .
            .
	    break;
         }   
      }
   }