Testing the input map name

Here should go questions about transforming XML with XSLT and FOP.
misty
Posts: 16

Testing the input map name

Wed Apr 20, 2016 12:06 am

Hi,

I'd like to add a link to the top of the webhelp TOC. If my input map is called foo.ditamap, I want the link to point to the output of bar.html. If my input map is called bar.ditamap, I want the link to point to the output of foo.html. So far I have this, but I'm not sure what I am able to test:

Code: Select all

                <div id="toggle_foo_or_bar_link">
                  <xsl:choose>
                    <xsl:when test="">
                      <p>You are viewing the Foo docs. View the <a href="bar.html" target="_blank">Bar</a> docs instead.</p>
                    </xsl:when>
                    <xsl:otherwise>
                      <p>You are viewing the Bar docs. View the <a href="foo.html" target="_blank">Foo</a> docs instead.</p>
                    </xsl:otherwise>
                  </xsl:choose>
                </div>


Can I access

Code: Select all

dita.input.filename
from within the Webhelp transform? If so, then I can test based on that. I have looked in the transform and I can't see where you parse it at all.
radu_pisoi
Posts: 310
Location: Craiova

Re: Testing the input map name

Wed Apr 20, 2016 2:36 pm

Hi,

To get the URL of the current processed DITA map you could use the document-uri() function. To find its name, you could use the function tokenize(document-uri(.), '/')[last()].

However, the next oXygen version that will be available until the end of this month, will include a new HTML output: Webhelp Responsive. This output is based on HTML templates and it is more easy to customize that the current WebHelp out. It has already defined empty place holders you can use to include custom HTML fragment in your publication, like external links for your case.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 0 guests