DITA and XMetaL Discussion
valtteri July 20, 2009 at 4:56 am
Disabling some automatically generated strings in CHM output.July 20, 2009 at 4:56 amParticipants 5Replies 6Last Activity 13 years, 6 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.
-ValtteriSu-Laine Yeo July 21, 2009 at 11:29 pm
Reply to: Disabling some automatically generated strings in CHM output.July 21, 2009 at 11:29 pm
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 Settings
Application 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.
Su-Lainevaltteri July 30, 2009 at 4:15 am
Reply to: Disabling some automatically generated strings in CHM output.July 30, 2009 at 4:15 am
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?
-ValtteriChris July 30, 2009 at 7:49 pm
Reply to: Disabling some automatically generated strings in CHM output.July 30, 2009 at 7:49 pm
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:
– ChrisSu-Laine Yeo July 30, 2009 at 9:54 pm
Reply to: Disabling some automatically generated strings in CHM output.July 30, 2009 at 9:54 pm
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-Lainevaltteri July 31, 2009 at 4:00 am
Reply to: Disabling some automatically generated strings in CHM output.July 31, 2009 at 4:00 am
Thanks for taking the time to look into these issues!
That really seems to work. Thanks a lot!
I'll try looking into that soon. Thanks for the tip.
-ValtteriDerek Read July 31, 2009 at 4:47 pm
Reply to: Disabling some automatically generated strings in CHM output.July 31, 2009 at 4:47 pm
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:
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).
- You must be logged in to reply to this topic.