private void sameTextNode ( ) throws TTIOException , XMLStreamException { // Update variables. mInsert = EInsert . NOINSERT ; mDelete = EDelete . NODELETE ; mInserted = false ; mInsertedEndTag = false ; mRemovedNode = false ; // Check if last node reached. // checkIfLastNode(false); // Skip whitespace events. skipWhitespaces ( mReader ) ; // Move to right sibling if next node isn't an end tag. if ( mReader . peek ( ) . getEventType ( ) != XMLStreamConstants . END_ELEMENT ) { // // Check if next node matches or not. // boolean found = false; // if (mReader.peek().getEventType() == // XMLStreamConstants.START_ELEMENT) { // found = checkElement(mReader.peek().asStartElement()); // } else if (mReader.peek().getEventType() == // XMLStreamConstants.CHARACTERS) { // found = checkText(mReader.peek().asCharacters()); // } // // // If next node doesn't match/isn't the same move on. // if (!found) { if ( mWtx . moveTo ( ( ( ITreeStructData ) mWtx . getNode ( ) ) . getRightSiblingKey ( ) ) ) { mMovedToRightSibling = true ; } else { mMovedToRightSibling = false ; } // } } mInsert = EInsert . ATMIDDLEBOTTOM ; }
In case they are the same nodes move cursor to next node and update stack .