Page 1 of 1

One Chapter/Topic with different overall formatting in a Bookmap

Posted: Wed Dec 09, 2015 6:43 pm
by josecotes
Hi there,

I have a Bookmap with the structure as below:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE bookmap PUBLIC "-//OASIS//DTD DITA BookMap//EN"
"bookmap.dtd">
<bookmap xml:lang="en">
<!-- METADATA HERE -->
<part format="dita" href="Part1.xml"/>
<chapter format="ditamap" href="Section1-1.ditamap"/>
<chapter format="ditamap" href="Section2-2.ditamap"/>
<chapter format="ditamap" href="Section3-3.ditamap"/>
</part>
<part format="ditamap" href="Part2.ditamap"/>
<part format="ditamap" href="Part3.ditamap"/>
<part format="ditamap" href="Part4.ditamap"/>
<appendix format="ditamap" href="AppendixA.ditamap"/>
</bookmap>
My question is, for those chapters inside part1, can I format them differently than the rest of the topics/parts in the rest of the books?

I was thinking about adding an outputclass to those as follows:

Code: Select all


		<chapter format="ditamap" href="Section1-1.ditamap" outputclass="section"/>
<chapter format="ditamap" href="Section2-2.ditamap" outputclass="section"/>
<chapter format="ditamap" href="Section3-3.ditamap" outputclass="section"/>
Then in file attr-set-reflection.xsl, I found the section that triggers the topics styles, i.e.:

Code: Select all


	....
<xsl:when test="$attrSet = 'topic.topic.topic.title'">
<xsl:call-template name="new-attr-set-reflection">
<xsl:with-param name="temp-element">
<xsl:element name="placeholder" use-attribute-sets="topic.topic.topic.title"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
....
Are these the sections where i have to put a conditional for this to work?

I will create new attrributes/styles, i.e. section.topic.topic.topic.title, but how do I add the conditional into attr-set-reflection.xsl and is this the right approach?

Thanks for all your help,

Re: One Chapter/Topic with different overall formatting in a Bookmap

Posted: Fri Dec 11, 2015 3:26 pm
by radu_pisoi
Maybe another solution is to override the template processTopicChapter from commons.xsl. This is the template used to process chapters from a bookmap.

In this template you should check if the current topic has the output class that you previously set. To accomplish that, you should verify if the input document contains a chapter with the same id as the current processed topic and also with the specified output class. The XPath condition: //chapter[@id=$cTopic/@id][@outputclass='section'] where $cTopic is the current processed topic. Please see that stage1a.xml file from the temporary folder. It is used as input for this transformation.

If all the above condition are fulfilled, you could style the current chapter as you wish by adding your custom attribute sets.