WebSphere Message Broker, Version 8.0.0.7
Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS
See information about the latest product version
See information about the latest product version
Configuring the DFDL annotations
The second stage of an approach to modeling data using DFDL involves adding DFDL
annotations to the logical structure that you established. The DFDL annotations describe the
physical format of the components.
Before you start: Follow the guidance in Understanding the logical structure.
Determine the characteristics of your components.

To continue with the example of a file of employee records, in which all data is text, with a dfdl:encoding of ASCII.
- The employees element does not have an initiator or a terminator so dfdl:initiator and dfdl:terminator are set to empty string ''. Its length is determined by its child elements, so dfdl:lengthKind is implicit.
- The sequence for employees has dfdl:sequenceKind ordered, because its child components always appear in the order specified.
- The employeeRecords element starts with {, so has a dfdl:initiator {{. (Two opening braces ({{) are needed to prevent the DFDL initiator from being misinterpreted as a DFDL expression.) The element ends with } and CR/LF, and so has dfdl:terminator }%CR;%LF;. (An alternative is to model the } and CR/LF as the separator of the parent sequence.) Again, its length is determined by its child elements, so dfdl:lengthKind is implicit.
- Its sequence has dfdl:sequenceKind ordered.
- Each simple element has dfdl:representation text. Each has a unique start tag that is used as the dfdl:initiator. Each has a variable length value that is delimited either by ',' or, if the element is last in the record, by } and CR/LF. Consequently, dfdl:lengthKind is delimited.
- The ',' delimiter is best modeled as the dfdl:separator of the parent sequence, and not as the dfdl:terminator of the element. The dfdl:separatorPosition is infix meaning that the ',' occurs only between the child elements in the sequence.
- Because each simple element has an initiator, dfdl:initiatedContent yes must be set on the parent sequence. This means the parser uses the initiator to positively identify each element.
- Although the salary element is optional, no DFDL discriminator is needed because the DFDL parser deduces that it is missing when it finds the employeeRecord terminator. When salary is missing, notice that the ',' before it is suppressed. That is modeled using dfdl:separatorSuppressionPolicy trailingEmpty on the parent sequence.
- Several other text-related properties must be set for each simple element. These properties control whether any padding or trimming takes place, and whether an escape scheme is in use to prevent data characters being interpreted as delimiters.
- Several other type-specific properties must be set for each simple element, to control the interpretation of the data value. For example, the permanent element is type xs:boolean and so needs dfdl:textBooleanTrueRep Y and dfdl:textBooleanFalseRep N.
The next stage is to organize the DFDL model: Organizing the DFDL model.