Is table scaling only available for CALS tables?

BobbyG66
Posts: 33
Joined: Tue Oct 15, 2013 11:35 pm

Is table scaling only available for CALS tables?

Post by BobbyG66 » Sat Feb 29, 2020 12:40 am

I checked the DITA specs and the scale attribute is only listed for CALS tables and not simple tables.
We just started using this attribute and like it a lot. But we just noticed that only CALS tables scale and not the simple tables.

We are using Oxygen version 18 and the scale attribute is available for simple tables. Is this correct, or has it been removed in future releases?

And has anyone added custom code to their PDF plugins to allow scaling in simple tables?

Here is the code I found in the org.dita.pdf2/xsl/fo/tables.xsl file.

Code: Select all

    <xsl:template match="*[contains(@class, ' topic/table ')]">
      <!-- FIXME, empty value -->
        <xsl:variable name="scale" as="xs:string?">
            <xsl:call-template name="getTableScale"/>
        </xsl:variable>

        <fo:block-container xsl:use-attribute-sets="table__container">
            <fo:block xsl:use-attribute-sets="table">
                <xsl:call-template name="commonattributes"/>
                <xsl:if test="not(@id)">
                  <xsl:attribute name="id">
                    <xsl:call-template name="get-id"/>
                  </xsl:attribute>
                </xsl:if>
                <xsl:if test="exists($scale)">
                    <xsl:attribute name="font-size" select="concat($scale, '%')"/>
                </xsl:if>
                <xsl:apply-templates select="*[contains(@class,' ditaot-d/ditaval-startprop ')]" mode="outofline"/>
                <xsl:apply-templates/>
                <xsl:apply-templates select="*[contains(@class,' ditaot-d/ditaval-endprop ')]" mode="outofline"/>
            </fo:block>
        </fo:block-container>
    </xsl:template>
Thanks
Bob

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

Re: Is table scaling only available for CALS tables?

Post by Radu » Wed Mar 04, 2020 2:44 pm

Hi Bob,

From what I see the @scale attribute can also be set on a <simpletable> without raising a validation error.
I see that indeed the PDF classic XSL-FO based output does not seem to take the @scale attribute set on simple tables into account, I added this issue for it:

https://github.com/dita-ot/dita-ot/issues/3470

Indeed you can probably try to create a PDF XSLT customization plugin which adds support for @scale also on simple tables.
As an alternative our DITA to PDF using CSS publishing should take the @scale attribute into account both on tables and simple tables.

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

Post Reply