code: public void visited(Node node) {
          switch(node.getNodeType()) {
          case Node.ATTRIBUTE_NODE:
              visitedAttribute(getNodeName(node));
              break;
          case Node.ELEMENT_NODE:
              visitedNode(node, getNodeName(node));
              break;
          case Node.COMMENT_NODE:
              visitedNode(node, XPATH_COMMENT_IDENTIFIER);
              break;
          case Node.PROCESSING_INSTRUCTION_NODE:
              visitedNode(node, XPATH_PROCESSING_INSTRUCTION_IDENTIFIER);
              break;
          case Node.CDATA_SECTION_NODE:
          case Node.TEXT_NODE:
              visitedNode(node, XPATH_CHARACTER_NODE_IDENTIFIER);
              break;
          default:
              // ignore unhandled node types
              break;
          }
      }
docs: Call when visiting a node whose xpath location needs tracking
  
  <p>Delegates to {@link #visitedAttribute visitedAttribute} for
  attribute nodes, {@link #visitedNode visitedNode} for elements,
  texts, CDATA sections, comments or processing instructions and
  ignores any other type of node.</p>
  
  @param node the Node being visited - must not be null.