Hi
I try to use manually controlled chunking with htmlhelp output. I followed the instructions in Bob Stayton's book (maketoc.xsl -> chunktoc.xsl) and I got the html output chunked the way I wanted, but the [FILES] section of the generated htmlhelp.hhp contains plain document text (merged text nodes) instead of file names. If I manually fix the [FILES] section of htmlhelp.hhp I can compile the help project and I get the expected chm file.
I would appreciate it if someone could confirm that this is an existing bug or someone could tell me if I am doing something wrong and help me to solve this problem.
1. I have made this simple book for testing:
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<book id="book1">
<chapter id="chap1">
</chapter>
</book>
2. My TestBooktoc.xml contains this:
<toc role="chunk-toc">
<tocentry linkend="book1">
<tocentry linkend="chap1">
<tocentry linkend="chap1__sec1">
</tocentry>
<tocentry linkend="chap1__sec2">
</tocentry>
</tocentry>
</tocentry>
</toc>
3. I replaced chunk.xsl with chunktoc.xsl in my htmlhelp.xsl so now it looks like this:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import href="html/chunktoc.xsl"/>
<xsl:include href="htmlhelp/htmlhelp-common.xsl"/>
4. I run myhtmlhelp.xsl with the following parameters:
chunk.section.depth=3
chunk.toc=TestBooktoc.xml
generate.section.toc.level=0
generate.toc=book toc,figure
htmlhelp.use.hhk=1
saxon.character.representation=native;decimal
use.id.as.filename=1 - It's not documented (at least I could not find any hint), but I had to realize that this does not work with chunktoc.xsl (maketoc.xsl also generates automatic file names).
5. Running the stylesheet gives properly chunked html files with auto-generated filenames: ch01.htm, ch01s01.html, ch01s02.html.
6. The generated htmlhelp.hhp file looks like this with document text in the [FILES] section:
[OPTIONS]
Binary TOC=Yes
Compatibility=1.1 or later
Compiled file=htmlhelp.chm
Contents file=toc.hhc
Default Window=Main
Default topic=index.html
Display compile progress=Yes
Full-text search=Yes
Language=0x0409 English (UNITED STATES)
Title=Book
Enhanced decompilation=No
[WINDOWS]
Main="Book","toc.hhc",,"index.html","index.html",,,,,0x2520,,0x703006,,,,,,,,0
[FILES]
BookChapter 1Section 1para1.Section 1_1para1_1Section 1_2para1_2Section 2para2
If I use chunk.xsl instead of chunktoc.xsl the [FILES] section is generated properly. I guess that when I use chunktoc.xsl the <xsl:apply-templates select="/" mode="enumerate-files"/> instruction in htmlhelp-common.xsl does not find matching template rule to generate the [FILES] section so it simply copies all text nodes to the output.
I use 1.73.1 version of the XSL Stylesheets and Saxon 6.5.
Regards
Tamas