Failed using webhelp macros

Post here questions and problems related to editing and publishing DITA content.
Posts: 3
Joined: Wed Jun 22, 2022 10:29 am

Failed using webhelp macros

Post by Nadia »

I use DITA-OT 2.54, webhelp 20.1 with the build 2018042310, and the oxygen.webhelp.responsive plugin.

I have to add the following meta tag to my wt_topic.html:

Code: Select all

<link rel="canonical" href="" />

It requres me to use a special variable for a topic id. I've read this article for webhelp 20.1, and found out that I can use the parameter topic-xpath that can be used to execute an XPath expression over the current topic.

I tried different parameters:

Code: Select all

<link rel="canonical" href="${topic-xpath(/topic/@id)}" /> //(my custom one)
<link rel="canonical" href="${topic-xpath(string-join(//shortdesc//text(), ' '))}" />  // (from the example)
<link rel="canonical" href="only this command works ${oxygen-webhelp-assets-dir}" /> // (from the example) 

But only the last one works. Can you recommend me, please, what I should fix to be able to insert a topic_id as a varible in the meta tag?

image.png (108.58 KiB) Viewed 165 times
Site Admin
Posts: 221
Joined: Thu Dec 24, 2009 11:21 am

Re: Failed using webhelp macros

Post by alin »


I have tested your example with WebHelp 20.1 and the macros were expanded correctly for all three <link> elements.

Alin Balasa
Software Developer
<oXygen/> XML Editor
Post Reply