Support DITA 1.3 rotate attribute

axhxu
Posts: 32
Joined: Thu Aug 27, 2015 9:28 pm

Support DITA 1.3 rotate attribute

Post by axhxu » Mon Jan 13, 2020 10:06 pm

Hi,
I am trying to add support to the Responsive webhelp for the dita 1.3 attribute @rotate for table cells.

I am trying to figure out how to add to the generated cell class if @rotate='1'.

Current generated element looks like:

Code: Select all

<th class="entry colsep-1 rowsep-1" id="rod1578579338781__table_v4s_1l2_p2b__entry__1"><div><span>Rotate Heading 1 with a really really long heading</span></div></th>
What I need is:

Code: Select all

<th class="entry rotate colsep-1 rowsep-1" id="rod1578579338781__table_v4s_1l2_p2b__entry__1"><div><span>Rotate Heading 1 with a really really long heading</span></div></th>
I think I need to override this template in table.xsl?:

Code: Select all

  <xsl:template match="@align | @valign | @colsep | @rowsep" mode="css-class">
    <xsl:sequence select="dita-ot:css-class((), .)"/>
  </xsl:template>
Or would I need to create an override based on the css-class.xsl templates?

Note I have already added and override for table entry in my customDita2webhelp.xsl:

Code: Select all

'<!-- IPTS-1165 -->
    <xsl:template match="*[contains(@class, ' topic/entry ')]" mode="table:entry">
        <xsl:apply-templates select="." mode="table:common"/>
        <xsl:apply-templates select="." mode="headers"/>
        <xsl:apply-templates select="@morerows, @dita-ot:morecols"/>
        <xsl:variable name="checkforText">
            <xsl:value-of select="./text()"/>
        </xsl:variable>
        <!--IPTS-1254; changed from if to choose -->
        
        <xsl:choose>
            <!--IPTS-1525 -->
            <xsl:when test="normalize-space(string($checkforText)) != '' and @rotate !='1'">
                <p class="p"><xsl:apply-templates/></p>
            </xsl:when>
            <!--IPTS-1525 -->
            <xsl:when test="@rotate ='1'">
                <div><span><xsl:apply-templates/></span></div>
            </xsl:when>
            <xsl:otherwise>
                <xsl:apply-templates/>
            </xsl:otherwise>
        </xsl:choose>
       
    </xsl:template>
I can apply changes to the generated cell content based on the @rotate value. So I am looking how to add the the class generation process for cells.

Thanks
Arron