Support DITA 1.3 rotate attribute
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 47
- Joined: Thu Aug 27, 2015 9:28 pm
Support DITA 1.3 rotate attribute
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:
What I need is:
I think I need to override this template in table.xsl?:
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:
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
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>
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>
Code: Select all
<xsl:template match="@align | @valign | @colsep | @rowsep" mode="css-class">
<xsl:sequence select="dita-ot:css-class((), .)"/>
</xsl:template>
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>
Thanks
Arron
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Support DITA 1.3 rotate attribute
Hi Aaron,
Sorry for the delay.
There is this XSLT stylesheet "OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\org.dita.html5\xsl\css-class.xsl" which has an xslt template like this:
maybe you can try to overwrite it in your customization and change the definition of the "class" variable to also include some mention of the rotation attribute value, something like:
Regards,
Radu
Sorry for the delay.
There is this XSLT stylesheet "OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\org.dita.html5\xsl\css-class.xsl" which has an xslt template like this:
Code: Select all
<xsl:template match="*" mode="css-class" priority="100">
Code: Select all
<xsl:variable name="class" as="xs:string*">
<xsl:if test="$outputclass">
<xsl:sequence select="data($outputclass)"/>
</xsl:if>
<xsl:next-match/>
<xsl:if test="@rotate">
<xsl:sequence select="concat('rotate', @rotate)"/>
</xsl:if>
</xsl:variable>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 47
- Joined: Thu Aug 27, 2015 9:28 pm
Re: Support DITA 1.3 rotate attribute
Thanks that worked I added the following to my customDita2webhelp.xsl:
I had to comment out the test for outputclass otherwise I ended up with "entry entry...." in the class.
Code: Select all
<xsl:template match="*[contains(@rotate,'1')]" mode="css-class" priority="120">
<xsl:param name="default-output-class"/>
<xsl:variable name="outputclass" as="attribute(class)?">
<xsl:apply-templates select="." mode="set-output-class">
<xsl:with-param name="default" select="$default-output-class"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:variable name="class" as="xs:string*">
<!--xsl:if test="$outputclass">
<xsl:sequence select="data($outputclass)"/>
</xsl:if-->
<xsl:next-match/>
<xsl:if test="@rotate">
<xsl:sequence select="'rotate'"/>
</xsl:if>
</xsl:variable>
<xsl:if test="exists($class)">
<xsl:attribute name="class" select="$class"/>
</xsl:if>
</xsl:template>
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service