This is a quick reference guide to using MorganaXProc (Rel. 1.0.6 or latter) from command-line. The syntax is very straight forward: You have to write the name of the XProc pipeline you want to run first and then you have to specify the settings and switches discussed below in arbitrary order.

General hints:

  • Relative URIs used on the command line will be resolved using the current working directory.
  • If you specify more than one setting for an input port, an output port or an option, only the last setting is respected.
  • Output ports are written the the given URI in alphabetical order of port name. This means that if you specify the same URI for more than one output port, you only get the documents of the last port, because the other are overwritten.
  • If more than one document appears on an output port, a documents are written to the same URI, so it will not contain a valid XML document, but a sequence of documents.
Setting or switch Description
-config:uri Specifies configuration document for MorganaXProc. If more than one configuration document is specified, there documents are processed in order of appearance.
-error:uri Redirects MorganaXProc's runtime error messages to the given URI.
-input:portname=uri Sets the input of the port with the given name to the given URI.
-input:portname=[System.in | stdin] Reads a document from the system input stream to the port with the given name. The base-uri of the read document will be "system://stdin".
-option:optionname=value Sets the option with the given name to the given value. Use Clark-notation ("{namespace-uri}local-name") to name options in a namespace. value is taken as a string. Put quotes around string containing blanks.
-output:portname=uri Writes the documents appearing on port portname to the given URI.
-output:portname=[System.out | System.err | stdout | stderr] Writes the documents appearing on port portname either to the respective system stream.
-output:portname=null Prevents documents appearing on port portname to be written.
-silent Prevents status informations and warning to be written. Runtime errors are written to System.err unless otherwise specified by command line setting -error:
-unsafe Bypasses MorganaXProc's security system when writing output ports. No checks will be performed and any existing resource with the same URI will be overwritten.

If run MorganaXProc from a shell script, you might be interested in reading the exit code (or exit status) of a run. MorganaXProc uses the following exit codes:

Code Description
0 Pipeline ran successfully.
1 Pipeline raised a runtime error.
2 Pipeline raised an error while compiling. (Usually an XProc syntax error)
3 MorganaXProc found an interface error preventing pipeline run. (Usually a wrong configuration in command line interface)
4 Any other kind of error.