Chapter 4 of the IREn User Guide
Using the Command Line
This topic describes how to run IREn from the command line.
4.1. Running IREn
IREn can be run from the command line, as follows:
-
On all platforms, by invoking Java directly from the command line.
-
On Windows, IREn can be run from a Command Prompt window via the
xep.batbatch file. -
On Linux, MAC, and UNIX, IREn can be run from a command shell, via the
xepbash script.
To learn more about the xep.bat batch file or the xep bash script, open the file in a text editor. These files use standard scripting features available in the operating system.
The syntax of the Java command is:
java com.renderx.xep.XSLDriver {options} {switches} {arguments}
The above syntax has been simplified by assuming that the directory containing the Java executable is specified in your PATH environment variable, and that the full path of the xep.jar file is in your CLASSPATH environment variable. If you specify an XSL file to convert an XML source document into XSL-FO, then it is assumed that saxon.jar or xt.jar are also specified in your CLASSPATH environment variable.
The syntax of the Windows batch and Linux/MAC shell command is:
xep {options} {switches} {arguments}
The above syntax assumes that the full path to the Windows batch file xep.bat or the Linux/MAC shell script xep is specified in the PATH environment variable, or that the current directory is the directory containing the Windows batch file or Linux/MAC shell script.
The options, switches, and arguments are the same whether IREn is run via Java, via a Windows batch file, or via a Linux/MAC shell script.
4.2. IREn Options
The IREn options are used to configure and customize the behavior of the IREn rendering engine.
IREn requires a configuration file in order to run. By default, the formatter looks for a file named xep.xml in the current directory. If a different configuration file is used, the path to the configuration file must be specified on the command line.
IREn is a flexible tool in which the configuration can be customized according to your preferences. There are several methods to customize IREn. These methods are summarized in the following table:
Table 4.1. Customizing IREn Configuration
| Customization | Description | Syntax |
|---|---|---|
Editing the configuration file. | The xep.xml configuration file can be customized, thereby customizing all transformations. There are two ways to customize the file:
| For editing xep.xml in a text editor, see Section 5.2.
For the IREn Assistant, see Section 5.1. |
| Setting a custom configuration file. | You can set a custom configuration file in the command line for a single file transformation. The location of the custom configuration file can be specified as either a file name in the local file system or as a URL.
All subsequent file transformations will continue to use the standard |
|
| Customizing the IREn configuration through the command line. | In the command line, the configuration can be customized for a single file transformation. The xep.xml file is not changed, and all subsequent file transformations are not affected.
|
|
Note: If any string contains spaces, the entire string must be enclosed in quotation marks.
4.3. IREn Switches
The IREn switches configure the behavior of the command line utility.
Table 4.2. IREn Switches
| Switch | Description |
|---|---|
-help | Displays the detailed syntax of the IREn switches and arguments. |
-hosted | The Java Virtual Machine continues to run after the renderer has completed rendering the file. |
-quiet | By default, IREn writes detailed messages to the command line console. These messages indicate the current status and progress of the rendering process, as well as any warnings or errors that may occur during the rendering process. Specify this switch to suppress the detailed informational messages. In this case, the renderer outputs only warning and error messages. |
-valid | The validation is turned off; IREn does not validate the input when rendering.
|
-version | Displays detailed version information of the IREn rendering engine. |
4.4. IREn Arguments
The IREn arguments instruct IREn how to process a file. For example, arguments may specify the input file, the target format to render to, and the output filename. When multiple arguments are specified, they must be specified in the following order:
( [-xml] <infile> [-xsl <stylesheet>] {-param <name=value>}
| -fo <infile>
| -xep <infile> )
[-format]
[[-<output format>] <outfile>]
The IREn arguments are described in the following table.
Table 4.3. IREn Arguments
4.5. Examples of Running IREn from the Command Line
This section presents a number of examples of how to run IREn from the command line.
To list all available options and switches:
-
At the system prompt, enter:
xep -help.A list of all available commands is displayed.
c:\myfiles>xep -help XEP 4.31.529 build 20230101 java com.renderx.xep.XSLDriver {<option>} {-quiet | -version | -valid | -hosted | -help} ( [-xml] <infile> [-xsl <stylesheet>] {-param <name=value>} | -fo <infile> | -xep <infile> ) [-f] [[-<output format>] <outfile>] Available output formats: at (XEP), xep (XEP), pdf (PDF), ps (Postscript), afp (AFP), svg (SVG), xps (XPS), html (XHTML), ppml (PPML).
To view the version of IREn you are currently running:
-
At the system prompt, enter:
xep -versionThe version you are currently running as well as the build are displayed.
c:\myfiles>xep -version XEP 4.31.529 build 20230101 (document [system-id file:stdin] -
Press
<Ctrl> + <C>to exit IREn interactive mode.
To render an XML document to PDF:
-
To render the XML document
CommandLine.xmlto PDF, using the stylesheetcustom-fo.xslto transform the XML to an XSL-FO document and relying on the default settings for the output format and output filename, at the system prompt, enter:xep CommandLIne.xml -xsl custom-fo.xsl