webhelp classic table caption

mross
Posts: 4

webhelp classic table caption

Wed Oct 03, 2018 10:58 pm

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: 243

Re: webhelp classic table caption

Thu Oct 04, 2018 12:03 pm

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/20.1/ug-webhelp-classic/topics/whr-override-xslt-dita-xslt-import.html

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
mross
Posts: 4

Re: webhelp classic table caption

Fri Oct 05, 2018 3:44 pm

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: 4

Re: webhelp classic table caption

Fri Oct 05, 2018 9:13 pm

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.

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 2 guests