Page 1 of 1

Responsive Webhelp: spaces between different keyword in output

Posted: Thu Nov 07, 2019 2:42 pm
by pieterjan_vdw
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?

Re: Responsive Webhelp: spaces between different keyword in output

Posted: Tue Nov 12, 2019 4:33 pm
by alin
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