Output PDF file name based on variables
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 6
- Joined: Wed Jan 24, 2024 4:36 pm
Output PDF file name based on variables
Post by oxygen-user »
Hi,
How can I make sure the PDF output file name is based on the DITA bookmap title (or certain keywords)?
I tested various methods but none of them worked.
Best wishes.
How can I make sure the PDF output file name is based on the DITA bookmap title (or certain keywords)?
I tested various methods but none of them worked.
Best wishes.
Code: Select all
<!-- Overwrite file name, See
https://www.oxygenxml.com/doc/versions/26.1/ug-pdf-css/topics/dcpp_parameters.html?hl=args.output.base
https://www.oxygenxml.com/doc/versions/26.0/ug-editor/topics/editor-variables.html?hl=xpath_eval
https://www.oxygenxml.com/forum/post71459.html#p71459
https://www.oxygenxml.com/forum/post54730.html#p54730
-->
<!--with rootmapURL https://www.oxygenxml.com/doc/versions/26.1/ug-editor/topics/editor-variables.html -->
<!--Transformation fails -->
<!-- <parameter name="args.output.base" value="${xpath_eval(doc('${rootMapURL}')//*[contains (@class, " front-page/front-page-title")]/*[contains(@class, " topic/title ")]/*[contains(@class, " topic/keyword ")][2])}"/> -->
<!-- Transformation fails -->
<!-- <parameter name="args.output.base" value="${xpath_eval(//*[contains (@class, " front-page/front-page-title")]/*[contains(@class, " topic/title ")]/*[contains(@class, " topic/keyword ")][2])}"/> -->
<!-- static -->
<!-- Transformation fails -->
<!-- <parameter name="args.output.base" value="${xpath_eval(normalize-space(string-join(/*[contains(@class, 'topic/title')]//text())))}"/> -->
<!-- Transformation fails -->
<!-- <parameter name="args.output.base" value="${xpath_eval(normalize-space(string-join(/*[contains(@class, 'map/map')]/*[contains(@class, 'front-page/front-page-title')]//text())))}"/> -->
<!-- Transformation fails -->
<!-- <parameter name="args.output.base" value="${xpath_eval(normalize-space(string-join(/*[contains(@class, 'map/map')]/*[contains(@class, 'topic/title')]//text())))}"/> -->
<!-- file name is identical to value -->
<!--<parameter name="args.output.base" value="${xpath_eval(upper-case(substring('${cfn}', 1, 4)))}"/>-->
<!-- dynamic -->
<!-- Transformation fails -->
<!-- <parameter name="args.output.base" value="${ask('Set new ID attribute', generic, '${xpath_eval(normalize-space(string-join(/*[contains(@class, 'front-page/front-page-title')]//text())))}"/> -->
<!-- <parameter name="args.output.base" value="${ask('Set new ID attribute', generic, '${xpath_eval(//*[contains (@class, " front-page/front-page-title")]/*[contains(@class, " topic/title ")]/*[contains(@class, " topic/keyword ")][2]}')}"/> -->
<!-- file name is identical to value -->
<!-- <parameter name="args.output.base" value="${ask('Message', input_type, '${cfn}')}"/> -->
Re: Output PDF file name based on variables
I'd recommend to read the metadata from your map after preprocessing (after keyrefs are resolved) and then do the renaming in a new Ant target at the end of the processing.
stefan-jung.org – Your DITA/DITA-OT XML consultant
-
- Posts: 545
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Output PDF file name based on variables
Post by julien_lacour »
Hello,
You cannot use rootmapURL editor variable in args.output.base value, only the following ones:
If you are using the DITA Map PDF - based on HTML5 & CSS scenario, you can debug the XPath expressions using the merged.html file.
If you still cannot make the transformation succeeds, could you copy the failure stacktrace here?
Regards,
Julien
You cannot use rootmapURL editor variable in args.output.base value, only the following ones:
- image.png (55.82 KiB) Viewed 277 times
If you still cannot make the transformation succeeds, could you copy the failure stacktrace here?
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