Formatting Topic Titles depending on the parent
Posted: Thu Aug 16, 2018 8:25 am
Hi all,
I have a bookmap as follows:
I'd like the titles on the preface to be red, the chapters to be blue and the appendix to be green. Here is my approach but it is not working for some reason:
At the moment all the titles are blue. It seems that the test fails and executes the otherwise.
Any clue?
On a related note. How do I not include the preface in the TOC and the Bookmarks? Inside the preface, I have different topics. With the first main topic is not included, but the subtopics are included. I would like the entire preface to be ignored.
THanks,
I have a bookmap as follows:
Code: Select all
<bookmap xml:lang="en">
<booktitle>
<booklibrary>Title</booklibrary>
</booktitle>
<frontmatter>
<preface href="preface1.xml" toc="no"/>
<booklists>
<toc/>
</booklists>
</frontmatter>
<chapter format="ditamap" href="chapter1.ditamap"/>
<chapter format="ditamap" href="chapter2.ditamap"/>
<appendix format="ditamap" href="appendix1.ditamap"/>
</bookmap>
Code: Select all
<xsl:template match="*" mode="processTopicTitle">
<xsl:choose>
<xsl:when test="parent::preface">
<fo:block color="red"><xsl:apply-templates select="." mode="getTitle"/></fo:block>
</xsl:when>
<xsl:when test="parent::appendix">
<fo:block color="green"><xsl:apply-templates select="." mode="getTitle"/></fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block color="blue">
<xsl:apply-templates select="." mode="getTitle"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Any clue?
On a related note. How do I not include the preface in the TOC and the Bookmarks? Inside the preface, I have different topics. With
Code: Select all
toc="no"
THanks,