DITA open tool kit is one of the best tool for single sourcing documentation. We have already prepared custom pdf plugin. I would like to share one of the very helpful tool that may help you quickly customise pdf plugin.
For example, Lets change our custom pdf plugin in such a way that it should be able to generate pdf output with combination of two column as well as single column structure. As you know, the structure of DITA open toolkit’s pdf plugin is as follows
Since, we want to change the layout of pages in output we need to customise layout-master.xsl.
|File to be copied||From||To|
|layout-master.xsl||DITA-OT Install folder/plugins/org.dita.pdf2/cfg/fo||DITA-OT install folder/plugins/com.myplugin.quickstart/cfg/fo|
|layout-masters-attrs.xsl||DITA-OT Install Folder/plugins/org.dita.pdf2/cfg/fo/attrs/||DITA-OT Install Folder/plugins/com.myplugin.quickstart/cfg/fo/attrs|
Open custom.xsl from <DITA-OT Install Folder>/plugins/myplugin.quickstart/cfg/fo/xsl and add the following line
Similarly, open custom.xsl from <DITA-OT Install Folder>/plugins/myplugin.quickstart/cfg/fo/attrs and add the following xsl import statement
Now, let’s edit layout-masters-attrs.xsl. Open the file using Notepad ++ and locate the attribute set region-body.odd
Add an attribute column-count to region-body.odd attribute set.
Now, we need to look for region-body.odd attribute set calls and make changes. You may find yourself searching for specific regions, attribute sets and variable names within various set of xsl files very frequently during the process of creating custom pdf plugins. Using wingrep utility to search within multiple xsl files came very handy here. You may download it from here.
Once wingrep utility is installed, right click on com.myplugin.quickstart folder and select Windows Grep
You will be prompted to enter search criteria
|1||Enter the search string – region-body.odd|
|2||In the file specification enter *.xsl|
|3||Locate the plugin folder com.myplugin.quickstart|
Windows grep will help you locate exact line numbers where the attribute set is called. You may locate each occurrence one by one.
Hope this will help you quickly edit xsl files while creating custom pdf plugins.