daffodil [GLOBAL_OPTIONS] <subcommand> [SUBCOMMAND_OPTIONS]
Setting environment variables may be necessary to allow for importing/includes to work and when running tdml files.
The Daffodil implementation will look on the classpath for includes and imports, and some tdml files. To define additional directories where Daffodil should look for files, set the DAFFODIL_CLASSPATH
environment variable, for example:
$ export DAFFODIL_CLASSPATH="/path/to/imports/:/path/to/includes/" |
In addition to defining directories to search for imports and includes, you can add a CatalogManager.properties
file to the DAFFODIL_CLASSPATH
to direct Daffodil to a relative path location of a user XML Catalog. For information on the CatalogManager.properties
file, visit the following website:
http://xerces.apache.org/xml-commons/components/resolver/tips.html#properties
If you need to specify java options specific to Daffodil, you can set the DAFFODIL_JAVA_OPTS
environment variable. If not specified, the JAVA_OPTS
environment variable will be used. If that is not specified, reasonable defaults for Daffodil will be used.
Long | Short | Arguments | Description |
---|---|---|---|
--debug | -d | [file] | Enable the interactive debugger. See the Interactive Debugger documentation for more information. The optional This option cannot be used with the |
--trace | -t | Enable a trace mode. This mode prints out helpful information during every stage of parsing. This option cannot be used with the | |
--verbose | -v | Enable verbose mode and increment verbosity level. Each additional v provides a new level of information. | |
--version | Display the version of Daffodil. | ||
--help | Display help message. |
Parse a file, using either a DFDL schema or a saved parser.
Note that the -P
or --parser
feature is not yet implemented (April 2013)
daffodil parse (-s <schema>... [-r <root> [-n <namespace>]] [-p <path>] | -P <parser>) [-D[{namespace}]<variable>=<value>...] [-T<tunable>=<value>] [-o <output>] [-V [mode]] [-c <file>] [infile]
Long | Short | Arguments | Description |
---|---|---|---|
--schema | -s | <schema> | The annotated DFDL schema to use to create the parser. This option may be supplied multiple times for multi-schema support. This option cannot be used with the --parser option. |
--root | -r | <root> | The root element of the DFDL schema to use. This must be one of the top-level elements of the schema defined with --schema. This requires the --schema option to be defined. If not supplied, the first element of the first schema defined with --schema is used. |
--namespace | -n | <namespace> | The namespace of the root element. Requires the --root option. |
--path | -p | <path> | The path to the node from the root element to create the parser from. |
--parser | -P | <parser> | Use a previously saved parser, created using the save-parser subcommand. This option cannot be used with the --schema option. |
-D | <variable>=<value> | Variables to be used when parsing. The variable can be prefixed with {namespace} to define which namespace the variable belongs in, for example:
| |
-T | <tunable>=<value> | Modify Daffodil configuration options to change parsing behavior. See Configuration File#Tunable Parameters for the list of tunable parameters. | |
--output | <output> | Write output to a give file. If the option is not given or is -, output is written to standard out. | |
--validate | -V | [mode] | The validation mode. 'on', 'limited' or 'off'. If 'mode' is not provided, defaults to 'on'. If --validate is not provided, defaults to 'off'. |
--config | -c | <file> | XML file containing configuration items, such as external variables or Daffodil tunables. See Configuration File for details on the file format. |
[infile] | Input file to parse. If not specified, or is a value of -, reads from standard in. In supplied, this must be the last option on the command line. | ||
--version | Display the version of Daffodil. | ||
--help | Display help message. |
daffodil parse -s csv.dfdl.xsd test_file.csv
Unparse an infoset file, using either a DFDL schema or a saved parser.
Note that the Unparse subcommand is not currently implemented (April 2013).
daffodil unparse (-s <schema>... [-r <root> [-n <namespace>]] [-p <path>] | -P <parser>) [-D<variable>=<value>...] [-T<tunable>=<value>] [-o <output>] [-V [mode]] [-c <file>] [infile]
Long | Short | Arguments | Description |
---|---|---|---|
--schema | -s | <schema> | The annotated DFDL schema to use to create the parser. This option may be supplied multiple times for multi-schema support. This option cannot be used with the --parser option. |
--root | -r | <root> | The root element of the DFDL schema to use. This must be one of the top-level elements of the schema defined with --schema. This requires the --schema option to be defined. If not supplied, the first element of the first schema defined with --schema is used. |
--namespace | -n | <namespace> | The namespace of the root element. Requires the --root option. |
--path | -p | <path> | The path to the node from the root element to create the parser from. |
--parser | -P | <parser> | Use a previously saved parser, created using the save-parser subcommand. This option cannot be used with the --schema option. |
-D | <variable>=<value> | Variables to be used when unparsing. The variable can be prefixed with {namespace} to define which namespace the variable belongs in, for example: | |
-T | <tunable>=<value> | Modify Daffodil configuration options to change parsing behavior. See Configuration File#Tunable Parameters for the list of tunable parameters. | |
--output | <output> | Write output to a give file. If the option is not given or is -, output is written to standard out. | |
--validate | -V | [mode] | The validation mode. 'on', 'limited' or 'off'. If 'mode' is not given, defaults to 'on'. If --validate is not present, defaults to 'off'. |
--config | -c | <file> | XML file containing configuration items, such as external variables or Daffodil tunables. See Configuration File for details on the file format. |
[infile] | Input file to unparse. If not specified, or is a value of -, reads from standard in. In supplied, this must be the last option on the command line. | ||
--version | Display the version of Daffodil. | ||
--help | Display help message. |
daffodil unparse -s csv.dfdl.xsd test_file.infoset
Create a save a parser that can be reused for parsing and unparsing.
Note that the save-parser command is not currently implemented (April 2013).
daffodil save-parser -s <schema>... [-r <root> [-n <namespace>]] [-p <path>] [-o <output>] [outfile]
Long | Short | Arguments | Description |
---|---|---|---|
--schema | -s | <schema> | The annotated DFDL schema to use to create the parser. This option may be supplied multiple times for multi-schema support. This option must be supplied. |
--root | -r | <root> | The root element of the DFDL schema to use. This must be one of the top-level elements of the schema defined with --schema. This requires the --schema option to be defined. If not supplied, the first element of the first schema defined with --schema is used. |
--namespace | -n | <namespace> | The namespace of the root element. Requires the --root option. |
--path | -p | <path> | The path to the node from the root element to create the parser from. |
--validate | -V | [mode] | The validation mode. 'on', 'limited' or 'off'. If 'mode' is not present, defaults to 'on'. If --validate is not present, defaults to 'off'. |
--config | -c | <file> | XML file containing configuration items, such as external variables or Daffodil tunables. See Configuration File for details on the file format. |
[outfile] | Write the parser to a give file. If the option is not given or is -, output is written to standard out. | ||
--version | Display the version of Daffodil. | ||
--help | Display help message. |
daffodil save-parser -s csv.dfdl.xsd csv_parser.xml
List or execute tests in a TDML file.
daffodil test [-l] [-r] <tdmlfile> [testname...]
Long | Short | Arguments | Description |
---|---|---|---|
--list | -l | Show names and descriptions in a TDML file instead of running them. | |
--regex | -r | Read <testnames> as regular expressions. | |
<tdmlfile> | Test Data Markup Language (TDML) file. | ||
[testname...] | Name of one or more test case in the tdml file. If not given, all tests in <tdmlfile> are run. | ||
--version | Display the version of Daffodil. | ||
--help | Display help message. |
daffodil test csv.tdml