Using the debugging and reporting tools

List and descriptions of the debugging and reporting tools

These tools (introduced in About the debugging, reporting, and file generation tools) are written in the PHP programming language and are meant to be invoked either from a command line prompt or from an Ant build script. The tools all take a single argument, which is the name of a DITA map file. The tools process all files in the hierarchy below the level of the invoked DITA map.

Tool Description
ditaauthors.php Returns a set of unique author and copyright strings, with counts for each.
ditadebug.php Produces several debugging and informational reports, most of them in a format that can be imported into a spreadsheet or a database. The reports include:
  • A list of any incorrect references found in the source files
  • A list of directories containing files used by the map
  • For each file in the map, its name, type, author, size, date last modified, and title
  • The total number of files by type
  • A list of all references found
ditaedit.php Can be used to search for and replace strings in all files in the DITA map..
ditaids.php Produces an alphabetical list of IDs for all files in the map, with duplicates marked with an asterisk.
ditakeys.php Produces a list of all metadata keywords defined.
ditalinks.php Tests all URLs referenced by files in the map for validity.

Software prequisites required

To run these tools you must have the PHP interpreter installed on your build machine. PHP is a free tool that can be downloaded from http://www.php.net.

Example of how to invoke the tools

You can include any of these tools as part of an Ant build script. The following example shows how to run the debugging tool and write the output to a file.

<!-- create the ditamap debug cross-reference -->
<target name="debug">
<echo>Building debugging file ditadebug.txt</echo>
<mkdir dir="${outdir}/debug_files"/>
<exec executable="${PHPdir}/php.exe" dir = "${projdir}" 
output="${outdir}/debug_files/ditadebug.txt">
<arg value="${projdir}/project/tools/ditadebug.php"/>
<arg value="${MAP_file}"/>
</exec>
</target>