Page 1 of 1

Table numbers in Web Help

Posted: Sat Dec 21, 2013 12:02 am
by cherbert
My company publishes to Web Help and PDF. I'm using the title element for tables so that the Table label and consecutive numbers appears in the PDF output. However, when I generate the Web Help the Table label always displays with the number 1. Is there a way to exclude the Table label and number from Web Help and still keep them in the PDF output?

Re: Table numbers in Web Help

Posted: Mon Dec 23, 2013 1:51 pm
by sorin_ristache
Hello,

To remove the table number and title from the Webhelp output please add the following two lines at the end of the file [Oxygen-install-dir]/frameworks/dita/DITA-OT/plugins/com.oxygenxml.webhelp/xsl/dita/dita2webhelp.xsl:

Code: Select all

    <xsl:template name="place-tbl-lbl"/>
<xsl:template match="*[contains(@class,' topic/table ')]/*[contains(@class,' topic/title ')]" mode="tabletitle"/>

Regards,
Sorin

Re: Table numbers in Web Help

Posted: Mon Dec 23, 2013 7:54 pm
by cherbert
Sorin,

I tried what you suggested. However, I could not save the [Oxygen-install-dir]/frameworks/dita/DITA-OT/plugins/com.oxygenxml.webhelp/xsl/dita/dita2webhelp.xsl file with the additions that you suggested. I get the following error message:

"Cannot save the file: C:\Program Files\Oxygen XML Editor 15\frameworks/dita/DITA-OT\plugins\com.oxygenxml.webhelp\xsl/dita\desktop\dita2webhelp.xsl (Access is denied).Please note that the file content might have been altered. A copy of the editor's content can be found in C:\Users\herbertc\AppData\Local\Temp\OxygenXMLtemp\oxy-dita2webhelp.xsl447343359028148048.xsl."

Also, what I wanted to remove from the web help was the Table label and Table number, not the Table title. For instance,

Table 2: This is the Title

I want to remove "Table" and "2". I want to keep the descriptive table title: "This is the Title".

Re: Table numbers in Web Help

Posted: Tue Dec 24, 2013 11:32 am
by sorin_ristache
cherbert wrote:I tried what you suggested. However, I could not save the [Oxygen-install-dir]/frameworks/dita/DITA-OT/plugins/com.oxygenxml.webhelp/xsl/dita/dita2webhelp.xsl file with the additions that you suggested. I get the following error message:

"Cannot save the file: C:\Program Files\Oxygen XML Editor 15\frameworks/dita/DITA-OT\plugins\com.oxygenxml.webhelp\xsl/dita\desktop\dita2webhelp.xsl (Access is denied).Please note that the file content might have been altered. A copy of the editor's content can be found in C:\Users\herbertc\AppData\Local\Temp\OxygenXMLtemp\oxy-dita2webhelp.xsl447343359028148048.xsl."
On Windows the files from C:\Program Files are editable only with admin priviledges. Please copy the file C:\Program Files\Oxygen XML Editor 15\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\xsl\dita\desktop\dita2webhelp.xsl in a different directory where you have write access (for example D:\myDir), edit the D:\myDir\dita2webhelp.xsl file as I suggest below, save it in the D:\myDir directory (where you do not get the Windows write interdiction error) and after that overwrite the original C:\Program Files version with this modified copy of the file.

cherbert wrote:Also, what I wanted to remove from the web help was the Table label and Table number, not the Table title. For instance,

Table 2: This is the Title

I want to remove "Table" and "2". I want to keep the descriptive table title: "This is the Title".
In that case you should add only the first line at the end of the dita2webhelp.xsl file, that is:

Code: Select all

<xsl:template name="place-tbl-lbl"/>
so that this file will end with:

Code: Select all

    <xsl:template name="place-tbl-lbl"/>
</xsl:stylesheet>

Regards,
Sorin

Re: Table numbers in Web Help

Posted: Wed Dec 16, 2020 1:36 pm
by syed
Hello,

I use Oxygen XML Author 21 and the output is Webhelp Responsive.

If i were to include the number 'Table 1' and the title, I think i might have to modify
DITA-OT3.x\plugins\com.oxygenxml.webhelp.responsive\xsl\dita2webhelp/dita2webhelpImpl.xsl
.

Is that correct? If yes, what change should i make in the xsl file?

If that's not correct, please let me know the correct file and the change.

Do let me know if the solution can be applied to version 22 and 23 as we might upgrade.

Thanks...
Syed

Re: Table numbers in Web Help

Posted: Mon Dec 21, 2020 3:43 pm
by radu_pisoi
Hi,

In Oxygen XML Author 21 that comes bundled with DITA-OT 3.3.1, the Table nr. label is generated from the following XSLT stylesheet, search for the 'topic/table' string:

Code: Select all

DITA-OT3.x/plugins/org.dita.html5/xsl/tables.xsl
If you want to modify the code, it is recommended to use DITA-OT extension points, in this case use the dita.xsl.html5 extension.

In the latest version 23, the DITA-OT processor was upgraded to version 3.5.4 that implies changes in XSLT files. So, it is possible that a change you made for DITA-OT 3.3.1 to not apply for a newer version.