Creating an index file for Master Index view

You can add your topics to the index so that they can be indexed through the Index view.

About this task
To create the index for your topics, perform the following steps:
  1. Add the following entry to the plugin.xml file before the </plugin> tag.
    <extension point="org.eclipse.help.index">
    <index file="index.xml" />
    </extension>

    Do not modify the <extension point="org.eclipse.help.index"> tag because it specifies that your document has an index definition.

    The <index file="index.xml" /> tag identifies that the index definition can be found in the index.xml file. You can modify the file name when necessary. You can also add multiple index elements to define all the index files for a plug-in. The help system combines the indexes lexicographically from every plug-in into one master index.

  2. Create an index file to describe the keywords and related topics. The name of the file must be consistent with the one you declared in the plugin.xml file. According to Step 1, the index file name should be index.xml. A document type definition (DTD) of an index file is as follows:
    <!ELEMENT index (entry)* >
    
    <!ELEMENT entry (entry | topic)* >
    <!ATTLIST entry keyword CDATA #REQUIRED >
    
    <!ELEMENT topic EMPTY >
    <!ATTLIST topic href CDATA #REQUIRED >
    <!ATTLIST topic title CDATA #IMPLIED >
    <!ATTLIST topic location CDATA #IMPLIED >
    The definitions of the elements and attributes are as follows:
    keyword
    the definition of the keyword for search in the Index view
    href
    the definition of the related topic to the keyword

    Each topic must have a "href" attribute that defines the file location of the topic. It must be a relative path to the plug-in directory.

    title
    the optional identifier of the title of the topics that will be displayed in the Select Topic window
    location
    the optional identifier of the location of the topics that will be displayed in the Select Topic window
    Note: An entry in an index.xml can have zero to as many associated topics as possible. Each topic is defined by the nested topic tag. An entry can have zero to as many nested sub entries as possible. Each sub entry defines a sub keyword displayed in the Index view.

    Following is an example of an index file:

    <index>
          <entry keyword="frame attribute" >
          <topic href="display-atts.html#display-atts" />
          </entry>
    
          <entry keyword="Accessibility">
                <entry keyword="Animations">
                <topic href="AccessAnimations.html#AccessAnimations" />
                </entry>
    
                <entry keyword="Cascading Style Sheets (CSS)" >
                <topic href="AccessCSS.html#AccessCSS" />
                </entry>
          </entry>
    </index>
Results
Note: You can use IBM® ID Workbench to create an index.xml file. It is created when your maps and topics contain index entries.
Restriction: IDWB generates different anchor names for an index.xml file and a toc.xml file. This might break the resync function. Verify the anchor names if you meet a sync problem.
Related tasks
Finding information with the Index view
Identifying the contents of your plug-in