Check condition in topic-xpath macro
Posted: Tue Feb 26, 2019 3:53 pm
Dear Oxygen-Team,
I'm currently using the macro "topic-xpath" in my Webhelp-Project in order to insert the value of the topic-attribute "product" in the HTML-Content.
The expression is as follows:
So far, this works fine and the static string + the attribute value are inserted in the HTML-Content.
The problem is, that the attribute "product" isn't always filled with a value. In the case that the value of the attribute is empty, I don't want to insert the above string in the HTML-Content. I've tried to use an if-statement within the macro, but this failed. Is there a way to achieve the conditional output with the "topic-xpath" macro?
Thank you and best regards,
Stephan
I'm currently using the macro "topic-xpath" in my Webhelp-Project in order to insert the value of the topic-attribute "product" in the HTML-Content.
The expression is as follows:
Code: Select all
<whc:macro value="${topic-xpath(string-join(('Note: The feature described above is available from release' , //attribute::product), ' '))}"/>
The problem is, that the attribute "product" isn't always filled with a value. In the case that the value of the attribute is empty, I don't want to insert the above string in the HTML-Content. I've tried to use an if-statement within the macro, but this failed. Is there a way to achieve the conditional output with the "topic-xpath" macro?
Thank you and best regards,
Stephan