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 ; } }
Call when visiting a node whose xpath location needs tracking