private Node [ ] processCurrNode ( final Node theNode , final Document theTargetDocument , final IndexEntryFoundListener theIndexEntryFoundListener ) { final NodeList childNodes = theNode . getChildNodes ( ) ; if ( checkElementName ( theNode ) && ! excludedDraftSection . peek ( ) ) { return processIndexNode ( theNode , theTargetDocument , theIndexEntryFoundListener ) ; } else { final Node result = theTargetDocument . importNode ( theNode , false ) ; if ( ! includeDraft && checkDraftNode ( theNode ) ) { excludedDraftSection . add ( true ) ; } for ( int i = 0 ; i < childNodes . getLength ( ) ; i ++ ) { final Node [ ] processedNodes = processCurrNode ( childNodes . item ( i ) , theTargetDocument , theIndexEntryFoundListener ) ; for ( final Node node : processedNodes ) { result . appendChild ( node ) ; } } if ( ! includeDraft && checkDraftNode ( theNode ) ) { excludedDraftSection . pop ( ) ; } return new Node [ ] { result } ; } }
Processes curr node . Copies node to the target document if its is not a text node of index entry element . Otherwise it process it and creates nodes with prefix in given namespace_url from the parsed index entry text .