DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Disabling some automatically generated strings in CHM output.

  • valtteri

    Disabling some automatically generated strings in CHM output.

    Participants 5
    Replies 6
    Last Activity 13 years, 2 months ago

    I would like to disable a few features in my CHM output but I can't quite figure out which files to edit. I'd like to have that automatic labeling and numbering of “figures with title” disabled so that instead of getting for example “Figure 3:

    ” I'd get only “ “. Also, I'd like to have that automatically generated string “Parent Topic” disabled.

    Can anyone help me out here? I think this requires some editing of XSLT but I'd appreciate some help on which files I should edit and how. I'd suppose it takes only commenting a few lines but then again, I'm not an XSLT expert.

    Thanks

    -Valtteri

    Reply

    Su-Laine Yeo

    Reply to: Disabling some automatically generated strings in CHM output.

    Hi,

    I'm not an XSLT expert either, so please take the following with a grain of salt:

    You can use a free text-search utility such as PSPad to search for a particular string in all files in a  folder. E.g. if you're looking for the string “Parent topic” in the Open Toolkit's XSL files, you can use PSPad to search for “Parent topic” in C:Documents and SettingsApplication DataSoftQuadXMetaL SharedDITA_OTxsl and its subfolders.

    The search results will include a lot of language files, which you can ignore, and a file called rel-links.xsl. That looks like it's probably the file you're looking for for “Parent topic”, although I haven't tried hacking it to verify.

    I think that most of the time, if you see the generated text “Foo” appear in U.S. English output, the relevant XSL file will also include the string “Foo”. In theory, however, you might need to open up the strings-en-us.xml file in order to see whether “Foo” in U.S. English output actually maps to something else in the XSL.

    Please let us know if this works.

    Cheers,
    Su-Laine

    Reply

    valtteri

    Reply to: Disabling some automatically generated strings in CHM output.

    Thanks for your help!

    That file indeed seems like it's the one I'm looking for. However, whatever changes I make in it, nothing happens as far as output is concerned. I'm a bit confused here since that really seems like the file I should be editing. Any ideas?

    -Valtteri

    Reply

    Chris

    Reply to: Disabling some automatically generated strings in CHM output.

    Valtteri,

    Try overriding the “place-fig-lbl” template in your customization; you'll see references to a variable called $fig-count-actual, which deals with numbering.

    The template can be found here:

    [DITA_OT]/xsl/xslhtml/dita2htmlImpl.xsl

    HTH,

    – Chris

    Reply

    Su-Laine Yeo

    Reply to: Disabling some automatically generated strings in CHM output.

    I managed to get the “Parent topic” label and link suppressed in CHM output on my machine, with a little help from Tom Magliery.

    My first attempt didn't work because I was removing the entire template:


             
             
                     
                 

             
                     
                 

             

             

    It worked when I commented out the contents of the template but not the element itself. I made it look like this:



    Su-Laine

    Reply

    valtteri

    Reply to: Disabling some automatically generated strings in CHM output.

    Thanks for taking the time to look into these issues!

    Su-Laine,
    That really seems to work. Thanks a lot!

    Chris,
    I'll try looking into that soon. Thanks for the tip.

    -Valtteri

    Reply

    Derek Read

    Reply to: Disabling some automatically generated strings in CHM output.

    For HTML-based outputs (including CHM) you could simply leave the output (HTML) alone and just modify your CSS file. To hide anything from readers you could simply use the CSS “display:none” property with the appropriate selector, like so:

    someSelectorConstruct {
      display:none;
    }

    That seems far easier to me than mucking with XSLT. The content is still there in the output (so viewing the source file will allow you to see it), so that is the only real consideration here I think. If you really want to remove it you will need to modify XSLT, but for generated content as described here I can't see that being a real concern.

    Note that the CHM viewer application hh.exe uses an embedded copy of IE to render HTML content so the CSS supported on any particular user's machine should probably take that into account. CSS display:none has been supported for a long time though, so that particular CSS property should work anywhere (I think it would be really hard to find a machine capable of opening a CHM that has a version of IE older than 5).

    Reply

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

Lost Your Password?

Products
Downloads
Support