DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Topic title not showing in web help TOC

  • MarcB

    Topic title not showing in web help TOC

    Participants 1
    Replies 2
    Last Activity 8 years, 5 months ago

    I'm using XMetaL Author Enterprise 8.0 on Windows 7.

    Assuming a topic that starts:

    I see that the @navtitle on the in the ditamap jumps to
    The @locktitle  is not set on the topicref, meaning the title should be taken from the referenced topic title.

    When I use web help as output option on Generate Output for Dita map, the topic title does not appear in the web help TOC. The log file contains nothing to indicate a problem.
    The HTML file is generated.
    The title also shows up fine in the TOC of PDF output.

    Is there a problem with the < in ?</p> <p>Thanks,<br />Marc<br />


    Derek Read

    Reply to: Topic title not showing in web help TOC

    Looks like one of two issues (resulting in the same problem):

    1) When the JavaScript array containing all the values used to display the ToC is generated < and > are not escaped as < and >
    To be a valid JavaScript array they don't need to be escaped, however, if they were then the other code that does the rendering of the ToC would work as written. You can make this change manually by escaping them in this file: “webhelp_outxmwebhelpscripttoc_data.js” That would need to be done each time you generate output, so obviously not a fix for the issue, but it will get your ToC working for now.

    2) The code that renders the ToC isn't written to handle these characters and escape them on the fly when encountered.

    Either way, the ultimate issue is that HTML is being rendered. The browser ignores it when it is an unrecognized tag, like in your case. If it were a recognized HTML tag then it might actually be rendered (an for example, or perhaps

    , etc). Still not a good thing since that would mess up the content in the ToC.

    I'll have our developers look into what it will take to make either of these changes so we can include a fix in a future release.
    If I can find the code that renders the ToC and the fix is easy enough to make I'll post something here.


    Derek Read

    Reply to: Topic title not showing in web help TOC

    Here's a quick fix.

    Open the following file (you can do this in the one included inside the DITA OT or after it has been copied into output): xmwebhelpscriptwebhelp.js

    Replace this line, near line 384:

    [code=Existing]listItem = listItem.replace(/{TITLE}/g, tocArray[0]);[/code]

    [code=New]listItem = listItem.replace(/{TITLE}/g, tocArray[0].replace(//g,”>”));[/code]

    This is escaping these characters later than they should be (in my opinion) to be an “elegant” solution. The end result should be identical however. Ideally it would be nice if this was done during the generation of the toc_data.js file itself (same folder). I'll leave that up to our developers to decide though. I believe that code is written in Java and so would need to be modified and then recompiled and deployed, so it is easier and quicker to make the change above.


  • You must be logged in to reply to this topic.

Lost Your Password?