How to delete the colon after Optional tag

Post here questions and problems related to editing and publishing DITA content.
lhsihan
Posts: 35
Joined: Thu Aug 15, 2019 5:31 pm

How to delete the colon after Optional tag

Post by lhsihan »

We don't want to have colon after "Optional" tag, how can we get this done?

The xml is as below:

Code: Select all

   <step importance="optional" >
                <cmd>test</cmd>
                <info>test</info>
            </step>
When transforming the doc to HTML5 format, we can see "Optional: " in HTML file. How can we make this as "Optional" without the colon?

Thanks a lot.
ionela
Posts: 400
Joined: Mon Dec 05, 2011 6:08 pm

Re: How to delete the colon after Optional tag

Post by ionela »

Hi,

Unfortunately, there is no easy out of the box way to remove the colon after the "Optional" tag. You can achieve this by developing a customization using XSLT extension points (this requires XSLT knowledge):
How to Use XSLT Extension Points from a Publishing Template
You can try to add and XSLT extension point on com.oxygenxml.webhelp.xsl.dita2webhelp:
XSLT-Import Extension Points

As a hint. using XSLT extension points you should override the standard functionality that inserts the colon from [DITA_OT_DIR]\plugins\org.dita.html5\xsl\task.xsl:

Code: Select all

  <xsl:template match="*" mode="add-step-importance-flag">
    <xsl:choose>
      <xsl:when test="@importance='optional'">
        <strong>
          <xsl:call-template name="getVariable">
            <xsl:with-param name="id" select="'Optional'"/>
          </xsl:call-template>
          <xsl:call-template name="getVariable">
            <xsl:with-param name="id" select="'ColonSymbol'"/>
          </xsl:call-template><xsl:text> </xsl:text>
        </strong>
      </xsl:when>
      <xsl:when test="@importance='required'">
        <strong>
          <xsl:call-template name="getVariable">
            <xsl:with-param name="id" select="'Required'"/>
          </xsl:call-template>
          <xsl:call-template name="getVariable">
            <xsl:with-param name="id" select="'ColonSymbol'"/>
          </xsl:call-template><xsl:text> </xsl:text>
        </strong>
      </xsl:when>
    </xsl:choose>
  </xsl:template>
I hope this helps.

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
Post Reply