Oxygen webhelp customization
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 42
- Joined: Wed Jun 20, 2018 11:30 am
Oxygen webhelp customization
Post by pieterjan_vdw »
I am trying to write a customization for Oxygen Webhelp but I don't succeed. This is what I am trying to do:
When I look into the sidetoc.xsl of the plug-in I see this line of code <xsl:copy-of select="@*[starts-with(local-name(), 'data-')]"/> collects the filtering attributes, for example audience, when they are set on the topicref of the DITAMAP and adds it to the side-toc.
What change do I have to make to the XSLT not to take the filtering attributes set on the topicref level, but the filtering attributes in the referenced topic?
Please find an example DITAMAP attached with passthrough ditaval.
I added the audience="de" attribute to the <topic> element in the file topic2.dita and I would like this attribute to be added to the side-toc of the Oxygen webhelp responsive.
Thanks a lot in advance.
- Publish DITAMAP with passthrough DITAVAL.
- The filtering attribute is set on topic level, not topicref. This was not possible in this particular case.
- I want to add the filtering attribute as attribute in the side toc.
When I look into the sidetoc.xsl of the plug-in I see this line of code <xsl:copy-of select="@*[starts-with(local-name(), 'data-')]"/> collects the filtering attributes, for example audience, when they are set on the topicref of the DITAMAP and adds it to the side-toc.
Code: Select all
<xsl:template match="toc:topic" mode="topic2html">
<xsl:param name="currentLevelHTML" tunnel="yes" as="node()*"/>
<xsl:param name="currentNode" as="xs:boolean" tunnel="yes"/>
<xsl:param name="precedingSiblings" tunnel="yes" as="xs:integer" select="0"/>
<xsl:param name="followingSiblings" tunnel="yes" as="xs:integer" select="0"/>
<xsl:variable name="vPosition" select="position()" />
<xsl:variable name="moreNext" select="$followingSiblings - $nodesVisible"/>
<xsl:variable name="morePrev" select="$precedingSiblings - $nodesVisible"/>
<!--
WH-231
Add the css selector for the side-toc compactation
-->
<li>
<xsl:if test="$currentNode"><xsl:attribute name="class" select="'active'"/> </xsl:if>
<xsl:if test="$followingSiblings and ($vPosition > $nodesVisible) and ($moreNext > 1)"><xsl:attribute name="class" select="'hide-after'"/></xsl:if>
<xsl:if test="$precedingSiblings and ((($precedingSiblings - $nodesVisible + 1) > $vPosition ) and ($morePrev > 1))"><xsl:attribute name="class" select="'hide-before'"/></xsl:if>
<xsl:if test="$currentNode">
<!--
The HTML content corresponding to the child topics will only be generated
if this node is the topic which the Publication TOC is being generated for.
-->
<xsl:attribute name="data-processing-mode" select="'linkPoint'"/>
</xsl:if>
<span data-tocid="{@wh-toc-id}">
<xsl:attribute name="class">
<xsl:value-of select="'topicref'"/>
<xsl:if test="@outputclass">
<xsl:value-of select="concat(' ', @outputclass)"/>
</xsl:if>
</xsl:attribute>
<!-- WH-1820 Copy the Ditaval "pass through" attributes. -->
<xsl:copy-of select="@*[starts-with(local-name(), 'data-')]"/>
<xsl:attribute name="data-state">
<xsl:variable name="hasChildren" as="xs:boolean">
<xsl:choose>
<xsl:when test="$WEBHELP_PUBLICATION_TOC_HIDE_CHUNKED_TOPICS = 'yes' and contains(@chunk, 'to-content')">
<xsl:value-of select="false()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="count(toc:topic) > 0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="boolean($hasChildren)">
<xsl:choose>
<xsl:when test="$currentNode">expanded</xsl:when>
<xsl:otherwise>not-ready</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>leaf</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:variable name="hrefValue">
<xsl:call-template name="computeHrefAttr"/>
</xsl:variable>
<span class="wh-expand-btn"/>
<span class="title">
<a href="{$hrefValue}" id="{@wh-toc-id}-link">
<xsl:if test="@scope='external'">
<!-- Mark the current link as being external to the DITA map. -->
<xsl:attribute name="data-scope">external</xsl:attribute>
</xsl:if>
<xsl:copy-of select="toc:title/node()"/>
</a>
<xsl:apply-templates select="toc:shortdesc" mode="topic2html"/>
</span>
</span>
</li>
</xsl:template>
Please find an example DITAMAP attached with passthrough ditaval.
I added the audience="de" attribute to the <topic> element in the file topic2.dita and I would like this attribute to be added to the side-toc of the Oxygen webhelp responsive.
ditaval_passthrough.zip
Anyone who can help me with this?Thanks a lot in advance.
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 275
- Joined: Thu Dec 24, 2009 11:21 am
Re: Oxygen webhelp customization
Hello,
The Publication TOC (Side TOC) is generated based on the structure of the expanded DITA map (that is the DITA map created in the WebHelp transformation's temporary directory).
The profiling attributes declared at topic level are not being transferred by default to the associated topicref elements in the DITA map.
DITA-OT has a dedicated pre-processing (mappull) step in which the topic's attributes and metadata are copied in the DITA map.
You can create a custom DITA-OT plugin that registers an XSLT file on the dita.xsl.mappull extension point and overrides the mappull step in the pre-processing pipeline. Here you can decide which attribute is copied from the DITA topic to the map's topicref.
The profiling attributes found on each topicref are transfered to the Publication TOC's entries as data-* attributes.
You can use the following DITA-OT plugin as an example: https://github.com/oxygenxml/oxygen-pub ... le.mappull
Regards,
Alin
The Publication TOC (Side TOC) is generated based on the structure of the expanded DITA map (that is the DITA map created in the WebHelp transformation's temporary directory).
The profiling attributes declared at topic level are not being transferred by default to the associated topicref elements in the DITA map.
DITA-OT has a dedicated pre-processing (mappull) step in which the topic's attributes and metadata are copied in the DITA map.
You can create a custom DITA-OT plugin that registers an XSLT file on the dita.xsl.mappull extension point and overrides the mappull step in the pre-processing pipeline. Here you can decide which attribute is copied from the DITA topic to the map's topicref.
The profiling attributes found on each topicref are transfered to the Publication TOC's entries as data-* attributes.
You can use the following DITA-OT plugin as an example: https://github.com/oxygenxml/oxygen-pub ... le.mappull
Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
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