Table of Contents File

The table of contents (TOC) file describes for the TOC navigator the content and layout of the TOC. The format of the TOC file is based on the World Wide Web Consortium (W3C) Extended Markup Language (XML). Following is a very small example of a TOC file:

<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE toc
  PUBLIC 
  "-//Sun Microsystems Inc.//DTD 
   JavaHelp TOC Version 2.0//EN"
  "http://java.sun.com/products/javahelp/toc_2_0.dtd">
<toc version="2.0">
  <tocitem image="toplevelfolder" 
           text="Java Development Environment">
     <tocitem target="jde.intro">Introduction to JDE Online Help />
     <tocitem text="IDE Tutorial" target="tut.starttoc">
        <tocitem text="Introducing JDE" target="tut.intro" />
        <tocitem text="Tutorial One" target="tut.quickstart" / >
        <tocitem text="Tutorial Two" target="tut.edit" />
        <tocitem text="Tutorial Three" target="tut.errors" />
     </tocitem>
     <tocitem text="Beans in JDE" target="bean.jbeanstory" />
     <tocitem text="Tips on Using Beans Effectively" 
              target="bean.beantips" 
              mergetype="javax.help.SortMerge" 
              presentationtype="javax.help.SecondaryWindow 
              presentationname="mainsw" />
  </tocitem>
</toc> 

This example produces the following TOC display:

The TOC Tags

The following table describes the TOC tags:

<toc> Defines the TOC. This tag contains <tocitem> tags and the following optional attributes.

xml:lang="lang" Language for the TOC. Use the standard locale-country-variant format.
Some examples:
xml:lang="de"
xml:lang="en"
xml:lang="en-US"
version="1.0"|"2.0" Version of JavaHelp software.
categoryclosedimage (optional) Specifies the image displayed to the left of a closed TOC folder. A TOC folder is any entry in the TOC that has subnodes. The argument to this attribute is an ID defined (associated with a GIF or JPEG image) in the map file. If this attribute is not specified, the default folder image is displayed.

You can override this setting for any single TOC folder by setting the folder's image attribute (see <tocitem> below).
categoryopenimage (optional) Specifies the image displayed to the left of an open TOC folder. A TOC folder is any entry in the TOC that has subnodes. The argument to this attribute is an ID defined (associated with a GIF or JPEG image) in the map file. If this attribute is not specified, the default folder image is displayed.

You can override this setting for any single TOC folder by setting the folder's image attribute (see <tocitem> below).
topicimage (optional) Specifies the image displayed to the left of a TOC topic. A TOC topic is an entry in the TOC that has no subnodes and links to a help topic. The argument to this attribute is an ID defined (associated with a GIF or JPEG image) in the map file. If this attribute is not specified, the default topic image is displayed.

You can override this setting for any single TOC topic by setting the topic's image attribute (see <tocitem> below).
<tocitem> Defines a TOC entry. Nesting entry1 in entry2 defines entry2 to be hierarchically contained within entry1. Uses the following attributes:
xml:lang="lang" Language for the TOC item. Use the standard locale-country-variant format.
Some examples:
xml:lang="de"
xml:lang="en"
xml:lang="en-US"
text Specifies the text that displays in the TOC.
target (optional) Specifies the ID to display when the entry is chosen by the user. IDs are defined (associated with a URL) in the map file. If this attribute is not used, the entry does not link to a topic
image (optional) Specifies the image displayed to the left of a TOC item. The argument to this attribute is an ID defined (associated with a GIF or JPEG image) in the map file. If this attribute is not specified, the default open folder, closed folder, or topic image is displayed.

This image overrides the global image, if any, specified for the <toc> tag's categoryclosedimage, categoryopenimage, or topicimage attributes (see <toc> above).
mergetype="class" (optional) Path to a valid merge class for the view. The default merge class for a TOC is javax.help.AppendMerge.
The merge classes are:
javax.help.UniteAppendMerge
javax.help.SortMerge
javax.help.AppendMerge
javax.help.NoMerge

For more information, see Merging Helpsets.

expand="true|false" (optional) Specifies whether to expand the TOC item and its subitems when the TOC initially opens. The default setting is "none", a setting that expands only the top level items.
presentationtype (optional) Specifies the type of window in which the topic will be displayed (defined in the <presentation> section of the .hs file). For more information, see the presentation feature in Helpset File.
presentationname (optional) Specifies the name of the window in which the topic will be displayed.

See also:

The Helpset File
JAR Files
Map File
Index File
Glossary File
Favorites File
Creating the Full-Text Search Database