Editor variables in WebHelp footer files for DITA

<oXygen/> general issues.
wintrymix
Posts: 1

Editor variables in WebHelp footer files for DITA

Tue Jun 02, 2015 9:10 pm

Environment:
Oxygen 17
DITA source
DITA-OT 1.8 (the one included in the Oxygen installation)
Windows 7 OS

We need to get a part number and build date into the footer of our WebHelp builds.

The ${date} editor variable would work for the build date. The Edit Parameter dialog for the webhelp.footer.file parameter says editor variables can be used in the footer file, but it's not clear to me how to include them so they resolve. I tried adding the variable to the HTML code in the footer XHTMLfile:

Code: Select all

<body>
   <div>${date(yyyy-MM-dd)}</div>
</body>


When I run the transformation, the editor variable is not resolved; it is output as a literal value. I also tried setting the editor variable directly as the value of the field, but that did not work either. Can anyone point me to a working example? None of my searches have located an example or clear instructions for this use case.

I'm not sure what to do for the part number. We don't want to have to update the footer file each time we run a transform, nor do we want to update a custom editor variable each time. The ideal solution would be to use the value of the <bookpartnumber> element in the bookmap, but I have not seen anywhere that it is passed through to the WebHelp output so it could be consumed. Can we get this value without custom processing?
sorin_ristache
Posts: 4144

Re: Editor variables in WebHelp footer files for DITA

Wed Jun 03, 2015 3:57 pm

wintrymix wrote:The Edit Parameter dialog for the webhelp.footer.file parameter says editor variables can be used in the footer file, but it's not clear to me how to include them so they resolve.



In the parameters dialog box if you click on the link associated with the text that says that editor variables are allowed, you can read in the user manual that the Oxygen editor variables can be used and will be replaced in the value of the webhelp.footer.file parameter, which is a file path for this particular parameter, not in the content of the file that is set as the value of the parameter.


wintrymix wrote:The ideal solution would be to use the value of the <bookpartnumber> element in the bookmap, but I have not seen anywhere that it is passed through to the WebHelp output so it could be consumed. Can we get this value without custom processing?


You can't get this value without custom processing because it requires modification inside a file that is supplied as a parameter to the DITA transformation. For example you can add a little ANT code at the beginning of the "dita.inner.topics.webhelp" task in the ANT file OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/com.oxygenxml.webhelp/build_dita.xml (before the xslt task executed inside "dita.inner.topics.webhelp") for replacing a placeholder like ${bookpartno} in your custom footer file with the value of the bookpartno element extracted from the DITA bookmap file.
Regards,
Sorin

<oXygen/> XML Editor Support

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 0 guests