Set table title above table

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Boreas
Posts: 86
Joined: Wed Feb 09, 2011 10:43 pm

Set table title above table

Post by Boreas » Tue Mar 08, 2016 4:30 pm

Hello,

I am trying to display the table titles above of the table, but with no success. :(

In the tables.xsl file I changed the mode value to titleAbove. (seemed very straight forward)

Code: Select all

<xsl:template match="*[contains(@class, ' topic/table ')]/*[contains(@class, ' topic/title ')]" mode="titleAbove" > 
with no success.

the tables-attr.sxl is as follows

Code: Select all

	<xsl:attribute name="keep-with-next.within-column">auto</xsl:attribute>		
<xsl:attribute name="font-size">10pt</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
<xsl:attribute name="keep-with-previous.within-column">always</xsl:attribute>
So what's missing? or wrong?

Regards

Radu
Posts: 7099
Joined: Fri Jul 09, 2004 5:18 pm

Re: Set table title above table

Post by Radu » Tue Mar 08, 2016 4:37 pm

Hi Carole,

I'm not sure what you mean because by default the table titles are displayed above the table for the PDF output. So probably this does not work by default for you because you created an XSLT customization which does otherwise.
Also you have set a mode on the table mode="titleAbove", the default PDF XSLTs never apply templates in that mode, did you add it for your XSLT own customizations to call the template in that mode?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Boreas
Posts: 86
Joined: Wed Feb 09, 2011 10:43 pm

Re: Set table title above table

Post by Boreas » Wed Mar 09, 2016 4:23 pm

Hi,

Yes the XSLT customization was changed to display the title under the table. I have been modifying our xslt to make them do what we want, but I did not start from scratch. Some changes were already implemented that I am just discovering now.
The Oxygen Pdf scenario does place the titles on top.
I compared the table.xsl and the table-attr.xsl files of the standard oxygen scenario with the one in my plugin and commented out what had been added.

I generated the the document, and....the titles are no longer displayed. I know I am at the rigth place, I just don't know what is missing.
Any idea where to look ?

In tables.xsl

Code: Select all


    <!--Media5 -->
<xsl:template match="*[contains(@class, ' topic/table ')]/*[contains(@class, ' topic/title ')]"> <!-- mode="titleAbove" -->
<fo:block xsl:use-attribute-sets="table.title">
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="insertVariable">
<xsl:with-param name="theVariableID" select="'Table'"/>
<xsl:with-param name="theParameters">
<number>
<xsl:number level="any" count="*[contains(@class, ' topic/table ')]/*[contains(@class, ' topic/title ')]" from="/"/>
</number>
<title>
<xsl:apply-templates/>
</title>
</xsl:with-param>
</xsl:call-template>
</fo:block>
</xsl:template>

Code: Select all


and removed <!--Media5 mode="titleBelow"
<xsl:apply-templates select="preceding-sibling::*[contains(@class, ' topic/title ')]" mode="titleBelow" />
-->
then in tables-attr.xsl

Code: Select all


  <xsl:attribute-set name="table.title" use-attribute-sets="base-font common.title">
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="space-before">6pt</xsl:attribute>
<xsl:attribute name="space-after">6pt</xsl:attribute>
<xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
<!--Media5
<xsl:attribute name="keep-with-next.within-column">auto</xsl:attribute>
<xsl:attribute name="font-size">10pt</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
<xsl:attribute name="keep-with-previous.within-column">always</xsl:attribute>
-->

Radu
Posts: 7099
Joined: Fri Jul 09, 2004 5:18 pm

Re: Set table title above table

Post by Radu » Wed Mar 09, 2016 4:35 pm

Hi Carole,

I'm not sure, I do not understand exactly what you are doing.
Maybe you can add xsl:message's in the stylesheets to find out more about what templates get called.
In the Oxygen Preferences->DITA page you can enable the DITA OT console view.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Boreas
Posts: 86
Joined: Wed Feb 09, 2011 10:43 pm

Re: Set table title above table

Post by Boreas » Wed Mar 09, 2016 6:04 pm

Hi,

ok. My plugin was created to generate the table title under the table. This was not done by me so I do not know what was exaclty changed to achieve this.
I want my plugin to generate the table title above the table, just as it does with the Oxygen default PDF scenario.

I first tried:
In the tables.xsl and tables-attr.xsl of my plugin, I commented out anything that seemed related to "titlebelow", but titles are no longer displayed.

I then tried:
In my plugin, I replaced the table.xsl and tables-att.xsl files by the ones of the org.dita.pdf2 plugin, but the titles did not generate, but the default table formatting was picked up.

now, I am out of ideas to solve the problem.

:(

Radu
Posts: 7099
Joined: Fri Jul 09, 2004 5:18 pm

Re: Set table title above table

Post by Radu » Thu Mar 10, 2016 9:19 am

Hi Carole,

If you can send via email (support@oxygenxml.com) your entire customization (before you started making changes to it) I could try to find some time to look into it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

shilpah123
Posts: 9
Joined: Wed Mar 13, 2019 6:37 am

Re: Set table title above table

Post by shilpah123 » Wed Mar 13, 2019 7:34 am

Were you able to repeat table title correctly on subsequent pages? I am looking for same functionality. I am using Oxygen 19.1, build 20 18022209 for DITA. Thanks.

Post Reply