X5 Keywords Bug

When importing topics from an earlier version with the index words in the topic rather than in the HHK file, the index words may not appear in the RH Index editor.

The author who reported this problem got the following response from MacroMedia:

Unfortunately, the only way to fix this issue is to insert the code into the rhkkeyword.apj file for each keyword. Once this is done, rename the cpd file, and then open the project, the Topic Keywords should now appear in the project under the index tab.

The correct syntax for adding the words is as follows:

<keyword>

<name>xxxx</name>

<keywords/>

</keyword>

where xxxx is the required keyword.

Note: Subsequent work on this issue has shown that the above is only correct for keywords and does not cover subkeywords. However, the instructions in this topic do cover what to do if you have keywords only or if you have keywords and subkeywords.

 

There are three ways to identify keywords in a project.

To Identify

Do

All keywords in the project Run a Topic References Report in RH.
All keywords held in topics in the project Search with PowerGrep or similar
All keywords in topics that have not appeared in the RH index editor Open the CPD file in Access and look for negative values in the K Keyword List table.

 

The following steps describe how to amend the rhkkeyword.apj file. Please note that this procedure is new and whilst it appears to create the required file, it is still being tested in live environments. It is vital therefore that you take backups at all stages.

Do let me know the results you get, either way.

Get list of missing keywords.

The first step is to get a list of the missing keywords.

Take a copy of the the CPD file and open it in Access.

Open the K Keyword List table and use Tools | Office Links in Access and send the list to Word.

From there, get the list into a text editor such as Notepad and tidy up as necessary so that the keywords are set out one per line with no blank lines. For this purpose a keyword such as "Bank Code" goes on one line.

You will then have a list something like

one

two

three

If you don't have Access, speak to your developers. They will probably be able to extract the necessary data.

Reformat List

The next stage is to get the list into the correct format as described above in the MacroMedia response. The correct format is:

<keyword>

<name>one</name>

<keywords/>

</keyword>

<keyword>

<name>two</name>

<keywords/>

</keyword>

<keyword>

<name>three</name>

<keywords/>

</keyword>

There are two options.

Option 1 - Manual

This must be done in a text editor and not in Word.

To be correct, you could rework the list in Word if you want to create a macro but the end result must be copied in the rhkkeyword.apj file in a text editor.

Option 2 - Use a Regular Expression

First Pass

This will reformat your list in seconds. Essentially a Regular Expression is a formula to find some text meeting the criteria and in this case, replace it with another string, what was found inserted into the XML.

Here you will need to understand Regular Expressions or find a developer who does, and not all developers will understand them.

You will need a text editor that can work with Regular Expressions such as EditPad. You need to open the text file with the keywords and then use the following expressions.

FIND (this part simply finds anything on one line)

(.*$)

REPLACE (this part replaces the line with following. The \1 bit tells it to put what was found in the line in that position.

<keyword>

<name>\1</name>

<keywords/>

</keyword>

Second Pass

If your file has subkeywords, they will appear on one line in the original text file in the format

keyword\subkeyword

In the file created from the first pass, they will appear as

<keyword>

<name>keyword\subkeyword</name>

<keywords/>

</keyword>

This needs to be converted to

<keyword>

<name>keyword</name>

<keywords>

<keyword>

<name>subkeyword</name>

<keywords/>

</keyword>

</keywords>

</keyword>

To do this, you need to run a second find and replace expression across the results of the first pass.

FIND

<keyword>

(.*)(\\)(.*$)

<keywords\/>

REPLACE

<keyword>

\1</name>

<keywords>

<keyword>

<name>\3

<keywords/>

</keyword>

</keywords>

Rename the CPD and open the project

Rename the CPD file as per the MM instructions and reopen the project.

The index should now be correct.

Topic Revisions

Date

Changes to this page

15 Dec 2004

Additional expression added to cope with subkeywords.

14 Dec 2004

New topic.