public IndexPreprocessResult process ( final Document theInput ) throws ProcessException { final DocumentBuilder documentBuilder = XMLUtils . getDocumentBuilder ( ) ; final Document doc = documentBuilder . newDocument ( ) ; final Node rootElement = theInput . getDocumentElement ( ) ; final ArrayList < IndexEntry > indexes = new ArrayList < IndexEntry > ( ) ; final IndexEntryFoundListener listener = new IndexEntryFoundListener ( ) { public void foundEntry ( final IndexEntry theEntry ) { indexes . add ( theEntry ) ; } } ; final Node node = processCurrNode ( rootElement , doc , listener ) [ 0 ] ; doc . appendChild ( node ) ; doc . getDocumentElement ( ) . setAttribute ( XMLNS_ATTRIBUTE + ":" + this . prefix , this . namespace_url ) ; return new IndexPreprocessResult ( doc , ( IndexEntry [ ] ) indexes . toArray ( new IndexEntry [ 0 ] ) ) ; }
Process index terms .