Package org.docx4j.toc
Class TocIntoSdt
java.lang.Object
org.docx4j.toc.TocIntoSdt
Modern versions of Word typically insert a ToC within an SDT (aka content control).
For example:
<w:sdt>
<w:sdtPr>
<w:docPartObj>
<w:docPartGallery w:val="Table of Contents"/>
This was not the case for now-ancient versions of Word.
And nor is it the case for a table of figures even now. For example:
<w:p>
<w:fldSimple w:instr=" TOC \h \z \c "Figure" ">
or
<w:r>
<w:fldChar w:fldCharType="begin"/>
</w:r>
<w:r>
<w:instrText xml:space="preserve"> TOC \h \z \c "Figure" </w:instrText>
</w:r>
<w:r>
<w:fldChar w:fldCharType="separate"/>
:
The purpose of this class is to find a "bare" TOC and wrap it in a content control.
Once this has been done, you can use TocGenerator's updateToc method on it.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
log
private static org.slf4j.Logger log
-
-
Constructor Details
-
TocIntoSdt
public TocIntoSdt()
-
-
Method Details
-
process
- Throws:
TocException
-