DITA footnote in table not working with PDF transform

Questions about XML that are not covered by the other forums should go here.
jspychka
Posts: 30
Joined: Fri Dec 10, 2010 9:43 pm

DITA footnote in table not working with PDF transform

Post by jspychka »

Hello,

When I add an <fn> in an <entry> in a table, then try to generate a PDF with a pretty much standard DITA-OT PDF transformation, all I get is the reference number at the appropriate spot but no text at the bottom of the page.

Outside a table, the <fn> tag works fine.

Any ideas on how to fix?

Thanks,

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

Re: DITA footnote in table not working with PDF transform

Post by Radu »

Hi John,

Tested with the DITA OT versions which come bundled with both Oxygen 12.0 and 12.1 and it seems to work OK.
Are you using a custom DITA Open Toolkit? What Oxygen version are you using.
Also maybe my sample topic table structure was too simple and did not mimic your DITA content.
Can you try with a very simple example with one table and one footnote in it like:

Code: Select all


<table>
<title>TEST</title>
<tgroup cols="2">
<thead>
<row>
<entry/>
</row>
</thead>
<tbody>
<row>
<entry>
<fn>The FOOT NOTE</fn>
</entry>
</row>
</tbody>
</tgroup>
</table>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jspychka
Posts: 30
Joined: Fri Dec 10, 2010 9:43 pm

Re: DITA footnote in table not working with PDF transform

Post by jspychka »

Hi Radu,

I tried your simple table sample and it worked. But my original problem persists. My actual table is not that much more complicated than your sample save the footnote is in <thead><row><entry>. See code below:

Code: Select all

<table frame = "all"
colsep = "1" rowsep = "1">
<tgroup cols = "2" colsep = "1" rowsep = "1" otherprops = "TaleoTable">
<colspec colnum = "1" colname = "1" colwidth = "1.291in"/>
<colspec colnum = "2" colname = "2" colwidth = "5.209in"/>
<thead>
<row rowsep = "1">
<entry colname = "1"></entry>
<entry colname="2">Performance and Recruiting Center<fn>Processor clock speed can make a difference
in performance. For best results, we recommend a processor with
a clock speed of at least 1.5 GHz where possible.</fn> - Minimum
Requirements</entry>
</row>
</thead>
<tbody>
<row rowsep = "1">
<entry colname = "1">Display</entry>
<entry colname = "2" align = "left">1024 X 768 or higher resolution.</entry>
</row>
<row rowsep = "1">
<entry colname = "1">Memory - Performance</entry>
<entry colname = "2" align = "left">256 MB of memory available after
the operating system and other applications have been loaded.</entry>
</row>
<row rowsep = "0">
<entry colname = "1">Memory - Recruiting Center</entry>
<entry colname = "2" align = "left">350 MB of memory available after
the operating system and other applications have been loaded.</entry>
</row>
</tbody>
</tgroup></table>
I am running v12.1.

Thanks,

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

Re: DITA footnote in table not working with PDF transform

Post by Radu »

Hi John,

Bad news, seems to be a bug in Apache FOP.
With XEP the foot note is generated fine at the end of the page.
I could try to add a bug to Apache FOP if you don't mind sharing the DITA sample.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jspychka
Posts: 30
Joined: Fri Dec 10, 2010 9:43 pm

Re: DITA footnote in table not working with PDF transform

Post by jspychka »

Thanks, Radu. It's okay to share my DITA sample.

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

Re: DITA footnote in table not working with PDF transform

Post by Radu »

Hi John,

No need, this seems to be already logged in:
https://issues.apache.org/bugzilla/show ... i?id=37579

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jspychka
Posts: 30
Joined: Fri Dec 10, 2010 9:43 pm

Re: DITA footnote in table not working with PDF transform

Post by jspychka »

Great. Thanks, Radu.

One last thing: Would you happen to know which stylesheet to change to adjust the font and font size of the footnote?

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

Re: DITA footnote in table not working with PDF transform

Post by Radu »

Hi John,

So the main template is in the OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/xsl/fo/commons.xsl:

Code: Select all

<xsl:template match="*[contains(@class,' topic/fn ')]">
........................................
But it uses predefined values from the XSL:
DITA-OT/demo/fo/cfg/fo/attrs/commons-attr.xsl

Look in it for the following attribute sets:

Code: Select all


<xsl:attribute-set name="fn">
...........
<xsl:attribute-set name="fn__id">
.............
<xsl:attribute-set name="fn__callout">
.............
<xsl:attribute-set name="fn__body">
..........
Maybe you can toggle some values on them and see how it works.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
yiyi_vivi
Posts: 13
Joined: Tue Nov 13, 2012 9:30 pm

Re: DITA footnote in table not working with PDF transform

Post by yiyi_vivi »

Hi Radu,

I think the predefined values in DITA-OT/demo/fo/cfg/fo/attrs/commons-attr.xsl only work for those footnotes used outside a table. Since when I changed the following code:
From

Code: Select all


<xsl:attribute-set name="fn__callout">
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
<xsl:attribute name="baseline-shift">super</xsl:attribute>
<xsl:attribute name="font-size">75%</xsl:attribute>
</xsl:attribute-set>
To

Code: Select all

<xsl:attribute-set name="fn__callout">
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
<xsl:attribute name="baseline-shift">super</xsl:attribute>
<xsl:attribute name="font-size">15%</xsl:attribute>
</xsl:attribute-set>
The callout of a footnote in a table cell will not change.

So how could we modify the attributes of a footnote within a table?

Thank you very much in advanced.

Best,
Ivy
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA footnote in table not working with PDF transform

Post by Radu »

Hi Ivy,

I am not very experienced with <fn> but here's what I think about this:
An <fn> has two parts:

1) The callout part. This part is the one which is rendered in-place in the content where you have inserted the footnote. By default the rendered value is 1, 2, so on. But you can also set the @callout attribute to a custom value.
The "fn__callout" attribute set controls the styling for this.

2) The part which appears at the end of the page. This is the foot note body.
The "fn__body" attribute set controls the styling for this.

You can test by setting a certain color in the attribute sets like:

Code: Select all

<xsl:attribute name="color">red</xsl:attribute>
and see if it reflects in the output.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
yiyi_vivi
Posts: 13
Joined: Tue Nov 13, 2012 9:30 pm

Re: DITA footnote in table not working with PDF transform

Post by yiyi_vivi »

Hi Radu,

Yes, you're right about fn_callout and fn_body, however I want to modify the font size of the callout of a footnote, since it is too big in a table. But the thing is whatever changes you made to the fn_callout, it will only affect those footnotes outside a table, not in a table. And there's no fn defined in tables.xsl and tables-attr.xsl.

Thanks,
Ivy
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA footnote in table not working with PDF transform

Post by Radu »

Hi Ivy,

I'm testing with DITA OT 1.7 (but I also tested with 1.6.1).
Specifying in the "fn__callout" attribute set a very small font size:

Code: Select all

 <xsl:attribute name="font-size">15%</xsl:attribute>
generated a callout with a very small font in the table cell.
So this worked for me, maybe you have additional customizations to the DITA OT which interfere with this.

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