Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DFDL Expressions and Daffodil Infoset Strings

We use Saxon-B and JDOM so as to utilize the XPath implementation to realize DFDL expressions.

DFDL Infoset strings are accommodated by way of a function daf:stringThe DFDL v1.0 specification now includes functions dfdl:decodeDFDLEntities(...). This function takes a single argument of type string, and it interprets the DFDL numeric entities and DFDL character entities notations, and inserts the corresponding characters into the string result.

In addition, if the DFDL character entities identify XML-illegal characters, then the PUA-replacement described above is performed.

and dfdl:encodeDFDLEntities(...) which take a string value as argument, and which decode DFDL's entity syntax (such as "%LF;") into the corresponding unicode characters (decode), or the inverse of that, creating a string containing DFDL entities for characters that have entities defined (encode). By use of these functions strings can be constructed at runtime for properties that must use character entities. For example, the dfdl:terminator property's value is a list of DFDL string literals separated by whitespace. Within each string literal in the list, any whitespace must be represented using DFDL entities such as "%SP;" for the space character.  In the situation where the dfdl:terminator property is obtained from an element earlier in the data stream containing a single character, that character could be " " (a space); hence, the expression for dfdl:terminator must be

    dfdl:terminator='{ dfdl:encodeDFDLEntities(../../terminatorElement) }'

The value of the terminator property would then be "%SP;" which means the terminator is a single space character.(Note 2012-12-05: this function is proposed to the DFDL Working Group for inclusion in DFDL version 1.0 standard, in which case it would used the standard prefix, i.e., dfdl:string(..) )

Daffodil Infoset and TDML Runner

...