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

Compare with Current View Page History

« Previous Version 2 Next »

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 namespace.

Configuration File
<?xml version="1.0" encoding="UTF-8"?>
<externalVariableBindings xmlns="" xmlns:ex="">
    <bind name="ex:var1">-9</bind>
    <bind name="ex:var2">Foo</bind>

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>

Configuration Schema

Below is the schema that defines this XML file:

Configuration Schema
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd=""
    xmlns:sub="" xmlns:xs=""
    xmlns="" targetNamespace=""
    <element name="externalVariableBindings" type="tns:externalVarType" minOccurs="1" maxOccurs="1"/>
    <complexType name="externalVarType">
            <element ref="tns:bind" minOccurs="0" maxOccurs="unbounded" />
    <element name="bind" type="tns:bindType" />
    <simpleType name="bindNameType">
        <restriction base="xs:string" />
    <complexType name="bindType">
            <extension base="tns:bindNameType">
                <attribute name="name" use="required">
                        <restriction base="xs:string" />
  • No labels