Solution for section breaks

Post here questions and problems related to editing and publishing DITA content.
Le Basque
Posts: 147
Joined: Sat Oct 19, 2013 8:21 am

Solution for section breaks

Post by Le Basque »

Hi,

I would like to section breaks using an attribute on topicref example base
idea :

Code: Select all

 <topicref format="dita" href="1.dita" scope="local" type="concept" base="BREAK"/>
Have you a solution ?

Thank you
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Solution for section breaks

Post by sorin_ristache »

Hello,

What type of breaks do you want to have and where? Do you want a page break after each topic in the output of the DITA PDF transformation applied on a DITA map so that each topic starts on a new page in the PDF output? Do you want to use the DITA break attribute as a specialized attribute to insert some separator space (what would that separator break be?) between the current topicref and the next sibling topicref? In what type of output?


Regards,
Sorin
Le Basque
Posts: 147
Joined: Sat Oct 19, 2013 8:21 am

Re: Solution for section breaks

Post by Le Basque »

hi,

I would like to choose the page breaks from the topics of ditamap. If the user wants a page break before a topic then it sets an attribute on the topic.

Thank you
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Solution for section breaks

Post by sorin_ristache »

Where do you want to set the page break? Do you want it in the output of the DITA PDF transformation?


Regards,
Sorin
Le Basque
Posts: 147
Joined: Sat Oct 19, 2013 8:21 am

Re: Solution for section breaks

Post by Le Basque »

Hi,

Yes in the output of the DITA PDF transformation
What I tried to do that does not work:

DITAMAP :

Code: Select all

<topicref format="dita" href="1.dita" scope="local" type="concept" base="BREAK"/>
File customize :

Code: Select all


    <xsl:template match="*" mode="processTopic">
<xsl:variable name="id" select="@id"/>
<xsl:variable name="topicref-base-att" select="concat(' ',lower-case(ancestor::*[contains(@class, ' map/map ')]/*[1]//*[contains(@class,' map/topicref ')][@id = $id]/@base),' ')"/>
<fo:block xsl:use-attribute-sets="topic">
<xsl:if test="contains($topicref-base-att, ' BREAK ')">
<xsl:attribute name="break-before">
<xsl:text>page</xsl:text>
</xsl:attribute>
</xsl:if>
...
Thank you
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Solution for section breaks

Post by sorin_ristache »

Hello,

That is a template that processes a topic, not the DITA map. Maybe it is easier if you set the attribute in the topic file, for example add the base attribute on the <topic> element.

If you want to keep the base attribute in the map file you have to find a template that processes the DITA map, but I think in this case it would be harder to find the place in the FO file where the page break should be inserted, when the topic file will be processed.


Regards,
Sorin
Post Reply