Code example for Document

Methods: getDocumentElement

0
        case (PROCESSING_INSTRUCTION): {
          throw new IllegalArgumentException(
              "PROCESSING_INSTRUCTION"); 
        } 
        case (START_DOCUMENT): {
          currentNode = document.getDocumentElement();
          return START_TAG;
        } 
        case (START_TAG): {
          if (currentNode.hasChildNodes()) {
            // The node has children, navigate down 
            return processNextNodeType( 
                currentNode.getFirstChild());
          } else { 
            // The node has no children 
            return END_TAG;
          } 
        } 
        case (TEXT): {
          return navigateToNextNode(currentNode);
        }