Content extraction

If the <convert> element contains a child called <extract> the source element which invoked the mapping is processed separately from the conversion stream.

The <extract> element may contain the following attributes:


The content is written to a file in the target output directory using the attribute value as the file name. If this attribute is not present the content will be discarded.


The content is transformed using an XSLT script before it is written. The file containing the script must be in the same directory as the stylesheet.

This facility can be used for conditional creation of the table of contents. When producing an output that contains its own table of contents it may be preferable to suppress the table of contents generated by the stylesheet. For example:

<mapping path="toc">
 <start class="block"/>
 <convert format="epub">