Output filename based on variables
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 3
- Joined: Tue Jul 16, 2019 5:17 pm
Output filename based on variables
Post by AndrewCampbell »
I'd like to be able to set the output base filename (the part specified by args.output.base) based on the value of some variables.
In my case, the mainbooktitle in each of my bookmaps consists of three ph elements which are in turn keyref'ed, something like this:
I would like the output filename to be something like "[value of Product]_[value of Release]_[value of DocumentType].pdf".
I can think of a few complex ways of making this happen by wrapping the DITA-OT in a shell script or something similar, but I'd prefer to do it as a regular plugin, especially as I could use a regular plugin within Oxygen. Is this possible?
In my case, the mainbooktitle in each of my bookmaps consists of three ph elements which are in turn keyref'ed, something like this:
Code: Select all
<mainbooktitle>
<ph keyref="Product"/>
<ph keyref="Release"/>
<ph keyref="DocumentType/>
</mainbooktitle>
I can think of a few complex ways of making this happen by wrapping the DITA-OT in a shell script or something similar, but I'd prefer to do it as a regular plugin, especially as I could use a regular plugin within Oxygen. Is this possible?
Re: Output filename based on variables
Hi Andrew,
I see you already got some answers on the DITA Users List.
I do not have a clear idea how a plugin could do that, probably if the plugin would have some custom ANT target which would be called before the PDF is produced, it could call an XSLT script to process the DITA Map from the temporary files folder (which would already have the keyrefs expanded). Then it would use the result produced by the XSLT script to set the value of the "args.output.base" parameter in the ANT build file.
Another Oxygen-specific approach would be to edit the transformation scenario and in the "Parameters" tab set a value for the "args.output.base" parameter using Oxygen specific editor variables like "${xpath_eval(expression)} ":
https://www.oxygenxml.com/doc/versions/ ... bles.htmle
and try to use XPath to read the value for each key from the DITA Map where it is defined. But this would work only inside Oxygen.
Regards,
Radu
I see you already got some answers on the DITA Users List.
I do not have a clear idea how a plugin could do that, probably if the plugin would have some custom ANT target which would be called before the PDF is produced, it could call an XSLT script to process the DITA Map from the temporary files folder (which would already have the keyrefs expanded). Then it would use the result produced by the XSLT script to set the value of the "args.output.base" parameter in the ANT build file.
Another Oxygen-specific approach would be to edit the transformation scenario and in the "Parameters" tab set a value for the "args.output.base" parameter using Oxygen specific editor variables like "${xpath_eval(expression)} ":
https://www.oxygenxml.com/doc/versions/ ... bles.htmle
and try to use XPath to read the value for each key from the DITA Map where it is defined. But this would work only inside Oxygen.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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