webhelp classic table caption

Post here questions and problems related to editing and publishing DITA content.
mross
Posts: 15
Joined: Wed Oct 03, 2018 10:36 pm

webhelp classic table caption

Post by mross »

Oxygen 20.1 DITA OT 2.x webhelp classic transform

I want to change: Table 1. Table label
to: Table: Table label

Where is the period after the table number being generated? Strings-en-us.xml <str name="Table">Table</str> does not contain the period.
ionela
Posts: 407
Joined: Mon Dec 05, 2011 6:08 pm

Re: webhelp classic table caption

Post by ionela »

Hi Mona,

Indeed, in the localization files (e.g. Strings-en-us.xml) is present only the table label not also the period. The period is added from the XSLT stylesheets used to process the input when the transformation scenario is run.
To may achieve this customization using XSLT extension points:
https://www.oxygenxml.com/doc/versions/ ... mport.html

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
mross
Posts: 15
Joined: Wed Oct 03, 2018 10:36 pm

Re: webhelp classic table caption

Post by mross »

I realize that the period in the caption title is added by a stylesheet.
I looked in DITA-OT2.x/plugins/org.dita.xhtml/xsl/xslhtml/tables.xsl AND
C:\oxygen_framework\DITA-OT2.x\plugins\org.dita.html5\xsl\tables.xsl
Line:1009-1014 appears to be adding the label:

<xsl:call-template name="getVariable">
<xsl:with-param name="id" select="'Table'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:value-of select="$tbl-count-actual"/>
<xsl:text>. </xsl:text>

If I change the period there to a colon, it doesn't change in the output. So I'm asking whether or not I am looking at the right XSL stylesheet or is this being pulled from another stylesheet?
mross
Posts: 15
Joined: Wed Oct 03, 2018 10:36 pm

Re: webhelp classic table caption

Post by mross »

I found where the period is added. It's in:

DITA-OT2.x\plugins\org.dita.html5\xsl\tables.xsl

Line:607: <xsl:sequence select="concat(dita-ot:get-variable(., 'Table'), ' ', $number, '. ')"/>

I copied this template that begins on line 605 - 608 to:

\DITA-OT2.x\plugins\com.oxygenxml.html.custom\custom.xsl

I changed the period to a colon, so that it matches the default figure caption label that is in the format Figure 1:

<xsl:sequence select="concat(dita-ot:get-variable(., 'Table'), ' ', $number, ': ')"/>

Whichever default caption formatting you want to use
Figure 1. Table 1.
Figure 1: Table 1:
Figure 1- Table 1-

It should be consistent in the pre-packaged code for webhelp output.
Post Reply