Daffodil provides extensions to the DFDL specification. These properties are in the namespace defined by the URI urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext
. To use these the Daffodil DFDL Extensions, bind this namespace to the daf
prefix in the xs:schema
element, like so:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext">
The following symbols defined in this namespace are described below.
daf:error()
A function that can be used in DFDL expressions. This functions does not return a value or accept any arguments. When called, it causes a Parse Error or Unparse Error.
This function is deprecated as of Daffodil 2.0.0. Use the fn:error(...)
function instead.
daf:trace($value, $label)
A function that can be used in DFDL expressions, similar to the fn:trace()
function. This logs the string $label
followed by $value
converted to a string and returns $value
. The second argument must be of type xs:string
.
daf:parseUnparsePolicy
A property applied to simple and complex elements, which specifies whether the element supports only parsing, only unparsing, or both parsing and unparse. Valid values for this property are parse
, unparse
, or both
. This allows one to leave off properties that are required for only parse or only unparse, such as dfdl:outputValueCalc
or dfdl:outputNewLine
, so that one may have a valid schema if only a subset of functionality is needed.
All elements must have a compatible parseUnparsePolicy with the compilation parseUnparsePolicy (which is defined by the root element daf:parseUnparsePolicy and/or the Daffodil parseUnparsePolicy tunable) or it is a Schema Definition Error. An element is defined to have a compatible parseUnparsePolicy if it has the same value as the compilation parseUnparsePolicy or if it has the value both
.
For compatibility, if this property is not defined, it is assumed to be both
.