file: URL for args.input results in bad value for args.input
Expected Behavior
When using -i or <context> in a project file, the value of args.input is generally usable as the basis for any Ant processing.
Actual Behavior
The value of args.input treats the input value as a path relative to the location where the dita command is run from, i.e.:
[echo] args.input=file\:/Users/eliot.kimber/git/utah/doc/source/bundle-appportman-application-portfolio-management.ditamap
And then when used in a normal (non-pipeline) Ant task:
com.servicenow.keyification.do-mapref-swapping:
[echo] [INFO] Swapping out peer maprefs in map "file:/Users/eliot.kimber/git/utah/doc/source/bundle-appportman-application-portfolio-management.ditamap"
[echo] [DEBUG] input.dir="/Users/eliot.kimber/git/dita-build-tools/ditaot/ditaot-keyification/file:/Users/eliot.kimber/git/utah/doc/source"
Where input.dir is constructed like so:
<dirname file="${args.input}" property="input.dir"/>
Which demonstrates that the value of args.input is not the URL "file:/..." but the path /Users/eliot.kimber/git/dita-build-tools/ditaot/ditaot-keyification/file:/Users/eliot.kimber/git/utah/doc/source
Possible Solution
None identified: I have been unable to find a general Ant solution that makes the initial value of args.input usable outside of a pipeline context.
Steps to Reproduce
- Run
ditacommand using-i file:/..../form with-v - Observe reported value of args.input
Copy of the error message, log file or stack trace
From this invocation:
~/git/dita-build-tools/ditaot/ditaot-keyification/bin/dita -i "file:/Users/eliot.kimber/git/utah/doc/source/bundle-appportman-application-portfolio-management.ditamap" -f xhtml -o ~/git/out -v
Get this result in the log:
[echo] args.input=file\:/Users/eliot.kimber/git/utah/doc/source/bundle-appportman-application-portfolio-management.ditamap
Environment
- DITA-OT version: 3.7.4
- Operating system and version: macOS Monterey
- How did you run DITA-OT? dita command
- Transformation type: Not relevant.
I am able to create a new property that removes any leading "file:" from args.input but this shouldn't be necessary:
<loadresource property="input.file.path">
<propertyresource name="args.input"/>
<filterchain>
<tokenfilter>
<replacestring from="file:" to=""/>
</tokenfilter>
</filterchain>
</loadresource>
<echo>[DEBUG] input.file.path="${input.file.path}"</echo>
Can't reproduce this with develop branch code. If I use e.g. -i file:/Volumes/tmp/src/root.ditamap, process runs without error just like with -i /Volumes/tmp/src/root.ditamap
URL file specifications work for me too, either with the -i option or in a DITA-OT project file.