Getting Started :: DocHelper
DocHelper can be used in two ways:
1.) It can be used as a stand alone executable or
2.) It can be used from within an ant script
In both cases you will need a document definition file in order to tell dochleper what it is you want it to do. Create a document definition file (doc.xml) like the one below and place it in path you remember as you will use it later.
<?xml version="1.0" encoding="UTF-8"?>
<document>
<documentdef name="example">
<recordsetref name="htmlFiles" >
<patternref name="title" />
</recordsetref>
<renderref name="Default" />
</documentdef>
<!-- pattern: Find the html-->
<pattern name="title">
<expression>title.(.*)./title</expression>
<nodedef class="TransformDefinitionImpl">\t\tTitle found: $1\n</nodedef>
</pattern>
<!-- Analysis of the Html Files, -->
<recordset class="FileRecordSet" name="htmlFiles" >
<!-- Params for Record Set : Search for all html file in current directory-->
<params>
<param name="path">.</param>
<param name="glob">*.html</param>
<param name="recursive">false</param>
</params>
</recordset>
<renderer class="FileRenderer" name="Default">
<params>
<param name="outputfile" >out.txt</param>
</params>
<docsections>
<docsection ref="htmlFilesRecord">
<start>\tFile : $filename\n\n</start>
<end></end>
</docsection>
<docsection ref="example" >
<start>--The titles of html files found in this directory are: \n\n--</start>
<end>-- --</end>
</docsection>
</docsections>
</renderer>
</document>
<document>
<documentdef name="example">
<recordsetref name="htmlFiles" >
<patternref name="title" />
</recordsetref>
<renderref name="Default" />
</documentdef>
<!-- pattern: Find the html-->
<pattern name="title">
<expression>title.(.*)./title</expression>
<nodedef class="TransformDefinitionImpl">\t\tTitle found: $1\n</nodedef>
</pattern>
<!-- Analysis of the Html Files, -->
<recordset class="FileRecordSet" name="htmlFiles" >
<!-- Params for Record Set : Search for all html file in current directory-->
<params>
<param name="path">.</param>
<param name="glob">*.html</param>
<param name="recursive">false</param>
</params>
</recordset>
<renderer class="FileRenderer" name="Default">
<params>
<param name="outputfile" >out.txt</param>
</params>
<docsections>
<docsection ref="htmlFilesRecord">
<start>\tFile : $filename\n\n</start>
<end></end>
</docsection>
<docsection ref="example" >
<start>--The titles of html files found in this directory are: \n\n--</start>
<end>-- --</end>
</docsection>
</docsections>
</renderer>
</document>
This document definition file tells dochelper to look for all html files and find their titles in the current directory (execution directory).
It will then generate a document called out.txt that details results found.
Using DocHelper as an executable utility.
0. Donwload and install Java.1. Download the executable jar from sourcefore. You can use this link
2. Change to a directory that contains some html files.
3. Execute the following command
java -jar [pathtodochelper.jar]/dochelper.jar [pathtodocxml]/doc.xml .
The file containing the reuslts should be generated.
4. Execute the follwing command to know usage options:
java -jar [pathtodochelper.jar]/dochelper.jar
Using DocHelper from ant.
0. Donwload and install Java and Ant.1. Download the dochelper_ant jar from sourcefore. You can use this link
2. Copy the dochleper_ant.jar file to your [ant home]/lib directory. 3. Modify or create an ant file in order to contain the following ant snippet:
<taskdef name="autodoc" classname="dochelper.ant.AntMain" />
<autodoc docdef="[pathtodocxml]/doc.xml" temppath="." />
The out.txt file should have been created.<autodoc docdef="[pathtodocxml]/doc.xml" temppath="." />