Line break inside <title> element in ditamap

164 views
Skip to first unread message

Rohit Ghosh

unread,
May 10, 2017, 2:39:25 AM5/10/17
to DITA-OT Users
Hi Sir,

I want to give line break in <map><title>something<sub>hello</sub></title></map>on <sub> element in frontmatter. How can I achieve this? Now it is showing in same line.

Jarno Elovirta

unread,
May 10, 2017, 2:41:26 AM5/10/17
to Rohit Ghosh, DITA-OT Users
Hi,

You have to override the stylesheet template for <sub> to generate the line break when the parent is map/title.

Jarno


On 10 May 2017, at 09:39, Rohit Ghosh <ro...@metapercept.com> wrote:

Hi Sir,

I want to give line break in <map><title>something<sub>hello</sub></title></map>on <sub> element in frontmatter. How can I achieve this? Now it is showing in same line.

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc

Rohit Ghosh

unread,
May 10, 2017, 3:58:00 AM5/10/17
to DITA-OT Users, ro...@metapercept.com
Hi Sir,

I am afraid I don't know the procedure of line break condition. I encountered this for the first time. A little help will be appreciated. beside the output is fine in bookmap condition

<!-- set the title -->
                    <fo:block xsl:use-attribute-sets="__frontmatter__title">
                        <xsl:choose>
                            <xsl:when test="$map/*[contains(@class,' topic/title ')][1]">
                                <xsl:apply-templates select="$map/*[contains(@class,' topic/title ')][1]"/>
                            </xsl:when>
                            <xsl:when test="$map//*[contains(@class,' bookmap/mainbooktitle ')][1]">
                                <xsl:apply-templates select="$map//*[contains(@class,' bookmap/mainbooktitle ')][1]"/>
                            </xsl:when>
                            <xsl:when test="//*[contains(@class, ' map/title ')]/@sub">
                                <xsl:value-of select="//*[contains(@class, ' map/title ')]/@sub"/>
                            </xsl:when>
                            <xsl:otherwise>
                                  <xsl:value-of select="newline"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </fo:block>
                    <!-- set the subtitle -->
                    <xsl:apply-templates select="$map//*[contains(@class,' bookmap/booktitlealt ')]"/>

                    <fo:block xsl:use-attribute-sets="__frontmatter__owner">
                        <xsl:apply-templates select="$map//*[contains(@class,' bookmap/bookmeta ')]"/>
                    </fo:block>

                </fo:block>

Toshihiko Makita

unread,
May 11, 2017, 3:36:06 AM5/11/17
to DITA-OT Users, ro...@metapercept.com
Hi Gosh,

> I want to give line break in <map><title>something<sub>hello</sub></title></map>on <sub> element in frontmatter.

I think it is not a good idea to use <sub> as expressing line-break because it is defined to subscripted in formatting. Instead of using <sub> how about using <data> element?

    <map><title>something<data name="line-break"/>hello</title></map>

The following template will handle this authoring properly:

    <xsl:template match="*[contains(@class,' map/map ')]/*[contains(@class,' topic/title ')]/*[contains(@class,' topic/data ')][string(@name) eq 'line-break']">
        <fo:block/>
    </xsl:template>

Regards,

-- 
/*--------------------------------------------------
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 --------------------------------------------------*/

2017年5月10日水曜日 16時58分00秒 UTC+9 Rohit Ghosh:
Reply all
Reply to author
Forward
0 new messages