How to disable headings in choicetables?

Post here questions and problems related to editing and publishing DITA content.
Anne
Posts: 24
Joined: Wed Dec 05, 2018 2:48 pm

How to disable headings in choicetables?

Post 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
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to disable headings in choicetables?

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Anne
Posts: 24
Joined: Wed Dec 05, 2018 2:48 pm

Re: How to disable headings in choicetables?

Post 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
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to disable headings in choicetables?

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Anne
Posts: 24
Joined: Wed Dec 05, 2018 2:48 pm

Re: How to disable headings in choicetables?

Post by Anne »

Thanks a lot!
Post Reply