Understanding Sun JavaHelp Files
Sun JavaHelp delivers content in HTML files. The table of contents, index, and helpset .hs files use the Extensible Markup Language (XML) format.
Helpset .hs File in Sun JavaHelp
The helpset .hs file contains configuration information in XML format that Sun JavaHelp needs to display your help system. The following figure shows a sample helpset file:
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 1.0//EN" "http://java.sun.com/products/javahelp/helpset_1_0.dtd">
<helpset version="1.0">
  <title>Interesting help project</title>
  <maps>
    <homeID>home</homeID>
    <mapref location="test.jhm" />
  </maps>
  <view>
    <name>TOC</name>
    <label>Interesting help project</label>
    <type>javax.help.TOCView</type>
    <data>testt.xml</data>
  </view>
  <view>
    <name>Index</name>
    <label>Index</label>
    <type>javax.help.IndexView</type>
    <data>testi.xml</data>
  </view>
  <view>
    <name>Search</name>
    <label>Search</label>
    <type>javax.help.SearchView</type>
    <data engine="com.sun.java.help.search.DefaultSearchEngine">
    JavaHelpSearch
    </data>
  </view>
</helpset>
The helpset file begins with an XML declaration. The next part of the file, as shown in the following sample, defines the help version, the title of the help, and the location of the mapping file that is used to support context-sensitive help:
<helpset version="1.0">
  <title>Interesting help project</title>
  <maps>
    <homeID>home</homeID>
    <mapref location="test.jhm" />
  </maps>
The remaining sections of the file define several views, such as the table of contents (TOC), index, and search. Each <view> tag includes several tags that define the view, such as the <name> tag that specifies the name of the view and the <data> tag that specifies the data file for the view.
You can also define your own views in Sun JavaHelp by overriding the template.hs file. For example, you can create an alternate list of topics and provide that list as a separate view.
Contents toc.xml File in Sun JavaHelp
The contents toc.xml file defines the items in the table of contents as shown in the following example file:
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE toc PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN" "http://java.sun.com/products/javahelp/toc_1_0.dtd">
<toc version="1.0">
  <tocitem target="tutorial_htm_1003580" text="Hybrid Web/CD:">
  <tocitem target="tutorial_htm_1004263" text="Roadmap"/>
  <tocitem target="tutorial_htm_1005107" text="Explosion"/>
  <tocitem target="tutorial_htm_999374" text="Bandwidth"/>
  ...
</tocitem>
</toc>
Index ix.xml File in Sun JavaHelp
The index ix.xml file lists your index entries as shown in the following example file:
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE index PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Index Version 1.0//EN" "http://java.sun.com/products/javahelp/index_1_0.dtd">
<index version="1.0">
  <indexitem target="tutor4_htm_999680" text="1996 Telecom Act"/>
  <indexitem target="tutor11_htm_999661" text="active catalog"/>
  <indexitem target="tutor10_htm_999632" text="ATM"/>
  <indexitem target="tutor10_htm_999634" text="audio synchronization"/>
  <indexitem text="bandwidth">
  ...
</index>
Map .jhm File in Sun JavaHelp
Sun JavaHelp supports context-sensitive help through a mapping .jhm file. The mapping file contains information that links your Sun JavaHelp topics to particular locations in the Java application. For more information, see “Using Context-Sensitive Help in Oracle Help and Sun JavaHelp”.