Page 1 of 1

How to disable headings in choicetables?

Posted: Tue Aug 20, 2019 11:37 am
by Anne
Hi,

By default, choice tables have column headings "Option" and "Description", which I think is redundant in a task step.
Is there a way to disable these headings?

Thanks,
Anne

Re: How to disable headings in choicetables?

Posted: Tue Aug 20, 2019 11:43 am
by Radu
Hi Anne,

The dialog used by Oxygen to insert a choice table has a checkbox called "Generate table header" which can be unchecked. Or you can manually remove the DITA <chhead> element from the table XML content.
Or if you do not want to modify the DITA content you will probably need to take care of this with some kind of publishing customization.

Regards,
Radu

Re: How to disable headings in choicetables?

Posted: Tue Aug 20, 2019 12:21 pm
by Anne
Hi Radu,

All my choicetables don't have the <chhead> element. I created a brand one without the Generate Header option, just to be sure.
But in the output the header Option/Description is always auto generated.

If there's no way to disable them in the content, how can this be done via customization?

Thanks,
Anne

Re: How to disable headings in choicetables?

Posted: Thu Aug 22, 2019 1:55 pm
by Radu
Hi Anne,

You did not specify what output format you obtain from DITA.
I will assume it's PDF using the classic XSL-FO approach.
In this XSLT stylesheet "OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT3.x/plugins/org.dita.pdf2/xsl/fo/task-elements.xsl" there is an xsl:template:

Code: Select all

  <xsl:template match="*[contains(@class, ' task/choicetable ')]">
which at some point does something like:

Code: Select all

      <xsl:choose>
        <xsl:when test="*[contains(@class, ' task/chhead ')]">
          <xsl:apply-templates select="*[contains(@class, ' task/chhead ')]"/>
        </xsl:when>
        <xsl:otherwise>
          <fo:table-header xsl:use-attribute-sets="chhead">
            <fo:table-row xsl:use-attribute-sets="chhead__row">
              <xsl:apply-templates select="." mode="emptyChoptionHd"/>
              <xsl:apply-templates select="." mode="emptyChdescHd"/>
            </fo:table-row>
          </fo:table-header>
        </xsl:otherwise>
      </xsl:choose>
That xsl:otherwise should probably be removed because it created the header row even when not specified in the DITA content.
More about PDF customizations:

https://www.oxygenxml.com/doc/versions/ ... utput.html

Regards,
Radu

Re: How to disable headings in choicetables?

Posted: Sun Aug 25, 2019 2:52 pm
by Anne
Thanks a lot!