modify webhelp content-help-map.xml to include an extra "topic title" attribute
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 10
- Joined: Thu Dec 07, 2017 5:51 pm
modify webhelp content-help-map.xml to include an extra "topic title" attribute
Hello,
I would like to modify the output of the responsive webhelp content-help-map.xml to include an extra "topic title" attribute to make the file more user friendly for developers who are implement the output as online help.
Smething like:
I can see that the file I need to add to is com.oxygenxml.webhelp.responsive\xsl\contextHelp\contextHelpMapDita.xsl
Add something like:
My question is - how do I build this list of topic titles? IS there a template that can be reused for this purpose? Any help much appreciated!
I would like to modify the output of the responsive webhelp content-help-map.xml to include an extra "topic title" attribute to make the file more user friendly for developers who are implement the output as online help.
Smething like:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<map>
<appContext helpID="troubles3459" path="mm_test/troubles3459.html" topictitle="Troubleshooting Procedure 1"/>
</map>
Add something like:
Code: Select all
<xsl:attribute name="topictitle" select="$topicTitle"/>
-
- Posts: 10
- Joined: Thu Dec 07, 2017 5:51 pm
Re: modify webhelp content-help-map.xml to include an extra "topic title" attribute
Ack. I can't seem to get this to work. I'm nearly there I think. The code gives me what I want for map topicrefs that have navtitles, I just can't seem to figure out to to pull in the titles from the topics themselves.
Am I missing something obvious or making a basic error about how to grab the topic title?
I included the full file below:
https://gist.github.com/aidanreilly/507 ... fcdeb71a13

Code: Select all
<!-- AR: getTopicTitle template -->
<xsl:template name="getTopicTitle">
<xsl:param name="topic"/>
<xsl:choose>
<xsl:when test="*[contains(@class, ' map/topic ')]/*[contains(@class, ' topic/title ')][@source = 'topic']">
<xsl:value-of select="*[contains(@class, ' map/topic ')]/*[contains(@class, ' topic/title ')][@source = 'topic']"/>
</xsl:when>
<xsl:when test="$topic/toc:title">
<xsl:value-of select="$topic/toc:title"/>
</xsl:when>
<xsl:when test="$topic/@title">
<xsl:value-of select="$topic/@title"/>
</xsl:when>
<xsl:when test="$topic/@navtitle">
<xsl:value-of select="$topic/@navtitle"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- AR: fin -->
I included the full file below:
https://gist.github.com/aidanreilly/507 ... fcdeb71a13



-
- Posts: 9437
- Joined: Fri Jul 09, 2004 5:18 pm
Re: modify webhelp content-help-map.xml to include an extra "topic title" attribute
Hi,
You should add an xsl:message on the xsl:template which matches each map/topicref like:
then publish and look in the DITA OT console for the logged values (Oxygen Preferences->DITA / Logging->Show console output->Always).
The topic title should appear in a topicmeta/navtitle element so you could try to extract it from there.
Regards,
Radu
You should add an xsl:message on the xsl:template which matches each map/topicref like:
Code: Select all
<xsl:message>MATCH <xsl:copy-of select="."/></xsl:message>
The topic title should appear in a topicmeta/navtitle element so you could try to extract it from there.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<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