## Index File

The index file describes to the index navigator the content and layout of the index. The format of the index file is based on the World Wide Web Consortium Extended Markup Language (XML). The following is a very small example of an index file:

    <?xml version='1.0' encoding='ISO-8859-1' ?>
       <!DOCTYPE index
         PUBLIC
         "-//Sun Microsystems Inc.//DTD
          JavaHelp Index Version 2.0//EN"
         "http://java.sun.com/products/javahelp/index_2_0.dtd">

       <index version="2.0">
          <indexitem text=".prof extension (profile data)"
                     target="prof.profile" />
          <indexitem text="accelerators (keyboard), see 'keyboard commands'" />
          <indexitem text="adding existing portfolio" target="proj.import" />
          <indexitem text="adding existing project">
             <indexitem text="naming project" target="proj.importdirectory" />
             <indexitem text="naming storage directory"
                        target="proj.importdirectory" />
             <indexitem text="procedures for" target="proj.importproject2" />
          </indexitem>
          <indexitem text="analyzing program performance, see 'profiler'" />
          <indexitem text="Java Applets">
             <indexitem text="overview" target="applet_over"
                        presentationtype="javax.help.SecondaryWindow
                        presentationname="mainsw">
             <indexitem text="editing in content page"
                        target="applet_editing">
             <indexitem text="inserting in content page"
                        target="applet_insert">
          </indexitem>
       </index>

#### The Index Tags

The following table describes the index tags:

`<index>`

Defines the index. It can contains `<indexitem>` tags and the following optional attributes.

`xml:lang="lang"`

Language for the index. 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.

.

`<indexitem>`

Defines an index entry. Nesting entry1 within entry2 defines entry2 to be hierarchically contained within entry1. Uses the following attributes:

`xml:lang="lang"`

Language for the index item. Use the standard locale-country-variant format.

Some examples:
  `xml:lang="de"`
  `xml:lang="en"`
  `xml:lang="en-US"`

`text=`"string" | Specifies the text that displays in the index.
`target=`"string" | (optional) Specifies the map ID of the topic that displays 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 index entry does not link to a topic (probably because it's being used to group sub-entries).

`mergetype`="class"

(optional) The path to a valid merge class for the view. The default merge type for an index 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 index item and its subitems when the index 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
  Map File
  JAR Files
  Table of Contents File
  Glossary File
  Favorites File
  Creating the Full-Text Search Database