Page 1 of 1

webhelp classic table caption

Posted: Wed Oct 03, 2018 10:58 pm
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.

Re: webhelp classic table caption

Posted: Thu Oct 04, 2018 12:03 pm
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

Re: webhelp classic table caption

Posted: Fri Oct 05, 2018 3:44 pm
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?

Re: webhelp classic table caption

Posted: Fri Oct 05, 2018 9:13 pm
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.