The Map File

When the JavaHelp system is activated by your application, the first thing it does is read the application's HelpSet file--the next thing it does is read the map file listed in the HelpSet file. The map file is used to associate topic IDs with URLs (paths to HTML topic files). By convention, map file names include the .jhm suffix.

The format of the map file is based on the World Wide Web Consortium Extended Markup Language (XML).

The following is an example of a short map file:


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

   <map version="1.0">
      <mapID target="toplevelfolder" url="images/toplevel.gif" />
      <mapID target="hol_intro" url="hol/hol.html" />
      <mapID target="halloween" url="hol/hall.html" />
      <mapID target="jackolantern" url="hol/jacko.html" />
      <mapID target="jacko_carving" url="hol/jacko.html#carving" />
      <mapID target="mluther" url="hol/luther.html" />
      <mapID target="reformation" url="hol/inforefo.html" />
      <mapID target="fawkes" url="hol/guy.html" />
      <mapID target="thanksgiving" url="hol/thanks.html" />
      <mapID target="thanksgiving_turkey" url="hol/thanks.html#turkey" />
      <mapID target="1thanksproc" url="hol/thanks2.html" />
      <mapID target="gwthanksproc" url="hol/thanks3.html" />
      <mapID target="althanksproc" url="hol/thanks4.html" />
      <mapID target="valentine" url="hol/val.html" />
      <mapID target="onlove" url="hol/love.html" />
   </map>

Note that images referred to as IDs (for example, in the TOC) can also be associated with an ID--in this example, toplevelfolder is associated with the GIF image toplevel.gif.

The Map Tags

The following are descriptions of the map tags:
<map> Defines the map. It contains <mapID> tags.
<mapID> Defines a map entry. Uses the following attributes:

target

Specifies the ID to associate with the URL specified in the url attribute.

url

Specifies the URL to associate with the ID specfied in the target attribute.

See also:

The HelpSet File
JAR Files
Table of Contents File
Index File
Creating the Full-Text Search Database