private void writeChapterIndex()

in src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java [331:382]


    private void writeChapterIndex( File index, Chapter chapter, IndexEntry chapterIndex, BookContext context )
        throws IOException
    {
        Writer writer = WriterFactory.newXmlWriter( index );

        ChapterXdocBookSink sink = new ChapterXdocBookSink( writer, chapterIndex, i18n, context.getLocale() );

        try
        {
            // -----------------------------------------------------------------------
            // Head
            // -----------------------------------------------------------------------

            sink.head();

            sink.title();
            sink.text( chapter.getTitle() );
            sink.title_();

            sink.head_();

            // -----------------------------------------------------------------------
            // Body
            // -----------------------------------------------------------------------

            sink.body();

            sink.section1();
            sink.sectionTitle1();
            sink.text( chapter.getTitle() );
            sink.sectionTitle1_();

            sink.list();
            for ( IndexEntry sectionIndex : chapterIndex.getChildEntries() )
            {
                writeSectionIndexForBookIndex( sink, sectionIndex );
            }
            sink.list_();

            sink.section1_();

            sink.body_();
        }
        finally
        {
            sink.flush();

            sink.close();

            IOUtil.close( writer );
        }
    }