The topicmerge feature improves the Toolkit build speed and reduces the possibility of encountering an "out of memory" exception in the build process.
With the enhanced topicmerge feature, this situation will be less likely. An intermediate merged file keeps the structure information in the ditamap, and the structured Toc will be reflected in the output.
Writing a simple script will help you learn about the effects of this feature. DITA Open Toolkit 1.3, provides the TopicMerge module to help you implement this feature. You can use this module to generate the merged files. Here is an example.
sample.xml:
<project name="sample">
<property name="dita.dir" value="${basedir}"/>
<import file="${dita.dir}${file.separator}build.xml"/>
<target name="premerge">
<antcall target="preprocess">
<param name="args.input" value="${input}"/>
<param name="output.dir" value="${dita.dir}${file.separator}output"/>
</antcall>
</target>
<target name="merge" description="Merge topics" depends="premerge">
<basename property="temp.base" file="${input}" suffix=".ditamap"/>
<property name="temp.input" value="${basedir}${file.separator}${dita.temp.dir}${file.separator}${temp.base}"/>
<dirname property="temp.dir" file="${temp.input}"/>
<pipeline message="topicmerge" module="TopicMerge"
inputmap="${temp.dir}${file.separator}${temp.base}.ditamap"
extparam="output=${dita.dir}${file.separator}output${file.separator}${temp.base}_merged.xml;
style=${dita.dir}${file.separator}xsl${file.separator}pretty.xsl" />
</target>
</project>