Condition in responsive web help build file
Having trouble installing Oxygen XML WebHelp? Got a bug to report? Post it all here.
-
- Posts: 1
- Joined: Wed Feb 12, 2025 7:01 pm
Condition in responsive web help build file
I need to add a condition to use publishing template based on a variable. Here is the current code currently in the responsive web help build file.
The variable is 'brand' and I want to change the value of 'template_location' based on the variable value.
An if/then statement is good, too. Basically:
if brand is X then <param name="template" value="${1}${2}templates${file.separator}location_x"/> .
if brand is Y then <param name="template" value="${1}${2}templates${file.separator}location_y"/> .
if brand is z then <param name="template" value="${1}${2}templates${file.separator}location_z"/> .
Ideas?
Code: Select all
<antcall target="dita2webhelp-responsive">
<param name="clean.output" value="no"/>
<param name="args.tablelink.style" value="TITLE"/>
<param name="template" value="${1}${2}templates${file.separator}template_location"/>
</antcall>
An if/then statement is good, too. Basically:
if brand is X then <param name="template" value="${1}${2}templates${file.separator}location_x"/> .
if brand is Y then <param name="template" value="${1}${2}templates${file.separator}location_y"/> .
if brand is z then <param name="template" value="${1}${2}templates${file.separator}location_z"/> .
Ideas?
-
- Posts: 1
- Joined: Sat Mar 22, 2025 11:50 am
Re: Condition in responsive web help build file
You can use Ant’s <condition> task to set template_location dynamically based on the brand variable. Here's how you can modify your build file:
This will dynamically assign template_location based on the value of brand before calling the target.
Code: Select all
<condition property="template_location">
<equals arg1="${brand}" arg2="X" />
<then>location_x</then>
<else>
<condition>
<equals arg1="${brand}" arg2="Y" />
<then>location_y</then>
<else>location_z</else>
</condition>
</else>
</condition>
<antcall target="dita2webhelp-responsive">
<param name="clean.output" value="no"/>
<param name="args.tablelink.style" value="TITLE"/>
<param name="template" value="${1}${2}templates${file.separator}${template_location}"/>
</antcall>
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service