1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
2 | <!-- This file is part of the DITA Open Toolkit project hosted on
|
---|
3 | Sourceforge.net. See the accompanying license.txt file for
|
---|
4 | applicable licenses.-->
|
---|
5 | <!--
|
---|
6 | | (C) Copyright IBM Corporation 2005 - 2006. All Rights Reserved.
|
---|
7 | *-->
|
---|
8 | <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
|
---|
9 | "concept.dtd">
|
---|
10 | <concept id="topicmerge" xml:lang="en-us">
|
---|
11 | <title>Topic merge</title>
|
---|
12 | <conbody>
|
---|
13 | <p>The topic merge feature improves the build speed of DITA files and reduces
|
---|
14 | the possibility of meeting the out of memory exception in the build process.
|
---|
15 | As illustrated in the following figure, when you run the build in previous
|
---|
16 | releases of DITA Open Toolkit, the build speed is slow and you are likely
|
---|
17 | to get out of memory exception.</p>
|
---|
18 | <fig>
|
---|
19 | <image href="images/outofmemory.jpg" placement="break"><alt>Out of memory exception</alt>
|
---|
20 | </image>
|
---|
21 | </fig>
|
---|
22 | <p>With this enhanced topic merge feature, you will be less likely to meet
|
---|
23 | the out of memory exception error when you build output through DITA files.
|
---|
24 | The intermediate merged file will keep the structure information in the DITA
|
---|
25 | map, and the structured toc will be reflected in the output.</p>
|
---|
26 | <p>To know more about this topic feature, you can write a script
|
---|
27 | file first. DITA OT 1.3 offers a module, <codeph>TopicMerge</codeph>, that
|
---|
28 | helps you implement this feature. You can use this module to generate the
|
---|
29 | merged files. A sample usage of this module is as follows.</p>
|
---|
30 | <p><lines>sample.xml:</lines><codeblock><project name="sample">
|
---|
31 | <property name="dita.dir" value="${basedir}"/>
|
---|
32 | <import file="${dita.dir}${file.separator}build.xml"/>
|
---|
33 |
|
---|
34 | <target name="premerge">
|
---|
35 | <antcall target="preprocess">
|
---|
36 | <param name="args.input" value="${input}"/>
|
---|
37 | <param name="output.dir" value="${dita.dir}${file.separator}output"/>
|
---|
38 | </antcall>
|
---|
39 | </target>
|
---|
40 | <target name="merge" description="Merge topics" depends="premerge">
|
---|
41 | <basename property="temp.base" file="${input}" suffix=".ditamap"/>
|
---|
42 | <property name="temp.input" value="${basedir}${file.separator}${dita.temp.dir}${file.separator}${temp.base}"/>
|
---|
43 | <dirname property="temp.dir" file="${temp.input}"/>
|
---|
44 | <pipeline message="topicmerge" module="TopicMerge"
|
---|
45 | inputmap="${temp.dir}${file.separator}${temp.base}.ditamap"
|
---|
46 | extparam="output=${dita.dir}${file.separator}output${file.separator}${temp.base}_merged.xml;
|
---|
47 | style=${dita.dir}${file.separator}xsl${file.separator}pretty.xsl" />
|
---|
48 | </target>
|
---|
49 | </project></codeblock></p>
|
---|
50 | <p>Then, you need to type <codeph>ant -f sample.xml merge -Dinput="C:\DITA-OT<keyword keyref="release.version"/>\test.ditamap</codeph>"
|
---|
51 | in the command window.<note>The path for -Dinput must be an absolute path</note></p>
|
---|
52 | </conbody>
|
---|
53 | </concept>
|
---|