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) and to define the window that can display help topics. By convention, map file names use the .jhm suffix.

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

The following code listing is an example of a short map file:

<?xml version='1.0' encoding='ISO-8859-1' ?>
PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Map Version 2.0//EN"
<map version="2.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" /> </mapID> </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 table describes the tags that can be used in the map file:


<map> Defines the map. It contains <mapID> tags and the following optional attributes.
xml:lang="lang" Language for the map file. Use the standard locale-country-variant format.

Some examples:

version="1.0"|"2.0" Version of JavaHelp software.
<mapID> Defines a map entry. Uses the following attributes:
xml:lang="lang" Language for the map ID. Use the standard locale-country-variant format.

Some examples:

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

See also:

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