Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

Daffodil has the capability to read in various parameters via an external XML file. Below are the parameters that can be defined.

External Variables

External variables can be defined using the externalVariablesBindings tag. For example, the following configuration file defines to variables, var1 and var2, in the http://example.com namespace.

Configuration File
<?xml version="1.0" encoding="UTF-8"?>
<dfdlConfig xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ex="http://example.com">
  <externalVariableBindings>
    <bind name="ex:var1">-9</bind>
    <bind name="ex:var2">Foo</bind>
  </externalVariableBindings>
</dfdlConfig>

These would allow the external variables to be set or overridden, if defined in a DFDL schema like so:

DFDL Schema
<dfdl:defineVariable name="var1" external="true" type="xsd:int">1</dfdl:defineVariable>
<dfdl:defineVariable name="var2" external="true" type="xsd:string">Bar</dfdl:defineVariable>

Tunable Parameters

Various tunable parameters can be modified to change various Daffodil schema compilation and data parsing properties. For example, the following sets the maxOccursBounds tunable to 1024:

Configuration File
<?xml version="1.0" encoding="UTF-8"?>
<dfdlConfig xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ex="http://example.com">
  <tunables>
    <maxOccursBounds>1024</maxOccursBounds>
  </tunables>
</dfdlConfig>

Below is the list of tunable parameters and their default values:

tunabledefaultdescription
generatedNamespacePrefixStem"tns"If elementFormDefault is qualified, but no prefix is associated with the targetNamespace, a prefix will be created using this value, with numbers appended if necessary to ensure uniqueness.
inputFileMemoryMapLowThresholdp225

In certain I/O optimized situations (text-only, encodingErrorPolicy='replace', fixed-width encoding) input files larger than this will be mmapped. Input files smaller than this will be simply read using ordinary I/O (because for small files that is just faster). This exists because mmap is more expensive than ordinary I/O for small files.

maxBinaryDecimalVirtualPoint200An upper limit on the value of the dfdl:binaryDecimalVirtualPoint property.
maxFieldContentLengthInBytes220A maximum limit for various daffodil I/O properties, including the maximim size of a simple element and maximum regular expression characters to match.
maxLengthForVariableLengthDelimiterDisplay10

When unexpected text is found where a delimiter is expected, this is the maximum number of bytes (characters) to display when the expected delimiter is a variable length delimiter.

maxOccursBounds1024A maximum limit for the number of repeats of array elements.
maxSkipLengthInBytes1024A maximum limit for the number of bytes that can be skipped in a skip region.
minBinaryDecimalVirtualPoint-200A lower limit on the value of the dfdl:binaryDecimalVirtualPoint property.
parseUnparsePolicy"both"

Whether to compile a schema to support parsing ("parseOnly"), unparsing ("unparseOnly"), both parsing and unparsing ("both"), or to use the daf:parseUnparsePolicy property from the root node ("schema").

requireBitOrderPropertyfalse

If true, require that the bitOrder property is specified. If false, use a default value for bitOrder if not defined in a schema.

requireEncodingErrorPolicyPropertyfalse

If true, require that the encodingErrorPolicy property is specified. If false, use a default value if not defined in a schema.

unqualifiedPathStepPolicy"noNamespace"

Specified how unqualified path steps are resolved. Value values are:

"noNamespace"

Unqualified path steps remain unqualified and will only match elements in NoNamespace. A prefix must be provided to match namespaced elements.

"defaultNamespace"

Unqualified path steps will always use the default namespace. If a default namespace is defined, it is not possible to match a NoNamespace element with this policy. Because of this, this may not work well with elementFormDefault="unqualified".

"preferDefaultNamespace"

Attempt to use the default namespace to resolve an unqualified path step. If that fails to match an element, then try to resolve using NoNamespace.

Configuration Schema

The schema for the configuration file is defined in dafext.xsd.

 

  • No labels