Responsive Webhelp: spaces between different keyword in output

pieterjan_vdw
Posts: 22
Joined: Wed Jun 20, 2018 11:30 am

Responsive Webhelp: spaces between different keyword in output

Post by pieterjan_vdw » Thu Nov 07, 2019 2:42 pm

Hi,

I want to see my keywords in each topic page.
I managed to get them visible in my webhelp via a fragment & Oxygen macro, but can't get spaces between the different keywords in my topic.

Keywords in the DITA topic:

Code: Select all

<keywords>
<keyword>compatibility</keyword>
<keyword>operate</keyword>
<keyword>system</keyword>
<keyword>window</keyword>
</keywords>

XHTML I currently use to get the output:

Code: Select all

<div class="keywords"  xmlns:whc="http://www.oxygenxml.com/webhelp/components">
	<p>Keywords: <b><whc:macro value="${topic-xpath(//keyword)}"/></b></p>
</div>

Final result in HTML:

Code: Select all

<div class="keywords">
	<p>Keywords: <b>compatibilityoperatesystemwindow<whc:macro value="${topic-xpath(//keyword)}"></whc:macro> </b></p>
</div>
How can I get a space between my different keywords in the HTML?

alin
Site Admin
Posts: 146
Joined: Thu Dec 24, 2009 11:21 am

Re: Responsive Webhelp: spaces between different keyword in output

Post by alin » Tue Nov 12, 2019 4:33 pm

Hello,

You need to adjust your XPath expression in order to concatenate all keywords using a space as separator:

Code: Select all

<div class="keywords"  xmlns:whc="http://www.oxygenxml.com/webhelp/components">
    <p>Keywords: <b><whc:macro value="${topic-xpath(string-join(//keyword, ' '))}"/></b></p>
</div>
Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply