project files param to PATH environment variable
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 10
- Joined: Fri May 22, 2020 6:44 pm
project files param to PATH environment variable
In a properties file, if I want to reference an .exe in the PATH environment variable all I need to do give the exe file name, e.g.:
But how do I do this with a parameter in an XML project file? Using AHFcmd.exe with both href and path tries to find the exe in the current directory and using ${env.PATH} returns a syntax error.
Would it work better in YAML or JSON?
Code: Select all
css.processor.path.antenna-house = AHFcmd.exe
Would it work better in YAML or JSON?
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: project files param to PATH environment variable
Post by julien_lacour »
Hello,
What do you mean by "in a property file"? I don't understand what is your goal here.
I assume you want to use the "DITA Map PDF - based on HTML5 & CSS" transformation in Oxygen.
If you want to use Antenna House using a variable, you may define a separate variable (for example 'AH_PATH') which value is the path to the AHCmd.exe file.
After, inside Oxygen open the transformation scenario and set the following values:
If you check inside your '.xpr' file this corresponds to
If this is not what you expect, please add details to your use-case and indicate which version of Oxygen you are using and which transformation you want to achieve.
Regards,
Julien
What do you mean by "in a property file"? I don't understand what is your goal here.
I assume you want to use the "DITA Map PDF - based on HTML5 & CSS" transformation in Oxygen.
If you want to use Antenna House using a variable, you may define a separate variable (for example 'AH_PATH') which value is the path to the AHCmd.exe file.
After, inside Oxygen open the transformation scenario and set the following values:
Code: Select all
css.processor.type = antenna-house
css.processor.path.antenna-house = ${env(AH_PATH)}
Code: Select all
...
<ditaScenario>
...
<field name="ditaParams">
<list>
<ditaParameter>
<field name="name">
<String>css.processor.path.antenna-house</String>
</field>
<field name="description">
<null/>
</field>
<field name="value">
<String>${env(AH_PATH)}</String>
</field>
</ditaParameter>
...
</list>
</field>
...
</ditaScenario>
...
Regards,
Julien
-
- Posts: 10
- Joined: Fri May 22, 2020 6:44 pm
Re: project files param to PATH environment variable
Hello Julien,
In the DITA OT I can use several types of file for configuring an output; properties (.properties), project (.xml, not .xpr) and publishing template (.opt)
In a properties file I can simply use "AHFCmd.exe" as the OT checks the PATH environment variable.
But this wasn't working with OT project files and any environment variable syntax I was trying was not working.
I am not using OT project files any more but would assume the syntax you have provide will also work with them. E.g.:
In the DITA OT I can use several types of file for configuring an output; properties (.properties), project (.xml, not .xpr) and publishing template (.opt)
In a properties file I can simply use "AHFCmd.exe" as the OT checks the PATH environment variable.
But this wasn't working with OT project files and any environment variable syntax I was trying was not working.
I am not using OT project files any more but would assume the syntax you have provide will also work with them. E.g.:
Code: Select all
<project xmlns="https://www.dita-ot.org/project">
<context name="User's Guide Filtered" id="ug_filtered">
<input href="userguide.ditamap"/>
<profile>
<ditaval href="filter.ditaval"/>
</profile>
</context>
<deliverable name="User's Guide to HTML5" id="ug_html5">
<context idref="ug_filtered"/>
<output href="./html5-output"/>
<publication transtype="pdf-css-html5">
<param name="css.processor.path.antenna-house" path="${env(AH_PATH)}"/>
</publication>
</deliverable>
</project>
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: project files param to PATH environment variable
Post by julien_lacour »
Hello,
You can use the PATH environment variable together with the DITA-OT Project file (.xml) following these steps:
Regards,
Julien
You can use the PATH environment variable together with the DITA-OT Project file (.xml) following these steps:
- Update your PATH environment variable and add Antenna House folder (something like "C:\Program Files\Antenna House\AHFormatterV70")
- Add in your XML file the following deliverable:
Code: Select all
<deliverable name="User's Guide to HTML5" id="ug_html5"> <context idref="ug_filtered"/> <output href="./html5-output"/> <publication transtype="pdf-css-html5"> <param name="css.processor.type" value="antenna-house"/> </publication> </deliverable>
Regards,
Julien
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: project files param to PATH environment variable
Post by julien_lacour »
Hello,
Another solution is to add the parameter in the command line:
Edit: Since Oxygen 23, it is possible to set the "css.processor.type" parameter from the Publishing Template Descriptor too.
Regards,
Julien
Another solution is to add the parameter in the command line:
Code: Select all
dita -f pdf-css-html5 -i custom.ditamap -o .\out\pdf-css-html5 -Dcss.processor.type="antenna-house"
Regards,
Julien
Return to “DITA (Editing and Publishing DITA Content)”
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