Topics

pass parameter using command line #DITA-OT

scott ashmead
 

Hi DITA users

Does anyone know of a way to pass in a parameter value from the DITA-OT command line?

Currently the param is hard-coded in the XSLT, but I'd like to have the flexibility to modify it.

This is how the param is defined in the XSLT...<xsl:param name="xyz" as="xs:string" select="'file:///c:/temp/xyz.xml'"/>

Regards,
Scott

Mark Giffin
 

Hi Scott,

I assume you are using a late-model DITA OT. Usually you can use the Java-style -Dnn syntax for extra command line parameters, like this example for the clean.temp parameter:

dita -f html5 -i path/to/mymap.ditamap -Dclean.temp=no

This sets clean.temp to no. This style is described here:

https://www.dita-ot.org/3.4/topics/build-using-dita-command.html

If your parameter is custom to your code, the parameter needs to be made available on the command line, and to do that there is an extra step, covered here:

https://www.dita-ot.org/3.4/topics/plugin-xsltparams.html

This works in a similar manner in 2.x versions of the OT. And even earlier!

Mark Giffin
Mark Giffin Consulting, Inc.
http://markgiffin.com/


On 3/24/2020 3:37 PM, scott ashmead via Groups.Io wrote:
Hi DITA users

Does anyone know of a way to pass in a parameter value from the DITA-OT command line?

Currently the param is hard-coded in the XSLT, but I'd like to have the flexibility to modify it.

This is how the param is defined in the XSLT...<xsl:param name="xyz" as="xs:string" select="'file:///c:/temp/xyz.xml'"/>

Regards,
Scott

scott ashmead
 

Thank You!

On Tuesday, March 24, 2020, 09:23:24 PM EDT, Mark Giffin <mark@...> wrote:


Hi Scott,

I assume you are using a late-model DITA OT. Usually you can use the Java-style -Dnn syntax for extra command line parameters, like this example for the clean.temp parameter:

dita -f html5 -i path/to/mymap.ditamap -Dclean.temp=no

This sets clean.temp to no. This style is described here:

https://www.dita-ot.org/3.4/topics/build-using-dita-command.html

If your parameter is custom to your code, the parameter needs to be made available on the command line, and to do that there is an extra step, covered here:

https://www.dita-ot.org/3.4/topics/plugin-xsltparams.html

This works in a similar manner in 2.x versions of the OT. And even earlier!

Mark Giffin
Mark Giffin Consulting, Inc.
http://markgiffin.com/


On 3/24/2020 3:37 PM, scott ashmead via Groups.Io wrote:
Hi DITA users

Does anyone know of a way to pass in a parameter value from the DITA-OT command line?

Currently the param is hard-coded in the XSLT, but I'd like to have the flexibility to modify it.

This is how the param is defined in the XSLT...<xsl:param name="xyz" as="xs:string" select="'file:///c:/temp/xyz.xml'"/>

Regards,
Scott