Data Format Description Language (DFDL) v1.0 Specification
OGF Proposed Recommendation GFD-P-R.174, January 31, 2011


13.2 Properties Common to All Simple Types with Text representation

Property Name

Description

textPadKind

Enum

Valid values ‘none’, 'padChar'.

Indicates whether to pad the representation text on unparsing.

‘none’: No padding occurs. When lengthKind is 'implicit' or 'explicit' the representation text must match the expected length otherwise it is a processing error.

'padChar': The element is padded using the dfdl:textStringPadCharacter, dfdl:textNumberPadCharacter, dfdl:textBooleanPadCharacter or dfdl:textCalendarPadCharacter depending on the type of the element

When lengthKind is 'implicit' the element is padded to the implicit length for the type.

When lengthKind is 'explicit' the element is padded to the length given by the dfdl:length property. When lengthKind is 'delimited', 'prefixed', 'pattern' or 'endOfParent' the element is padded to the length given by the xs:minLength facet for type 'xs:string' or dfdl:textOutputMinLength property for other types.

Annotation: dfdl:element, dfdl:simpleType

textTrimKind

Enum

Valid values ‘none’, ‘padChar’

Indicates whether to trim data on parsing.

When 'none' no trimming takes place

When 'padChar' the element is trimmed of the dfdl:textStringPadCharacter, dfdl:textNumberPadCharacter, dfdl:textBooleanPadCharacter or dfdl:textCalendarPadCharacter depending on the type of the element..

Annotation: dfdl:element , dfdl:simpleType

textOutputMinLength

Non-negative Integer.

Only used when dfdl:textPadKind is 'padChar' and dfdl:lengthKind is 'delimited', 'prefixed', 'pattern' or 'endOfParent', and type is not xs:string

Specifies the minimum representation length during unparsing for simple types that do not allow the xs:minlength facet to be specified. The units are specified by the dfdl:lengthUnits property. If dfdl:textOutputMinLength is zero or less than the length of the representation text then no padding occurs.

Annotation: dfdl:element, dfdl:simpleType

escapeSchemeRef

Qname or empty String

The name of the dfdl:defineEscapeScheme annotation that provides the additional properties used to describe the escape scheme. If the value is the empty string then escaping is explicitly turned off.

See The dfdl:defineEscapeScheme Annotation Element and The dfdl:escapeScheme Annotation Element

Annotation: dfdl:element, dfdl:simpleType

13.2.1 The dfdl:escapeScheme Properties

The dfdl:escapeScheme annotation is used within a dfdl:defineEscapeScheme annotation to group the properties of an escape scheme and allows a common set of attributes to be defined that can be reused.

An escape scheme is needed when the contents of a text element contains sequences of characters that are the same as an in-scope separator or terminator. If the characters are not escaped, a parser scanning for a separator or terminator would erroneously find the character sequence in the contents.

An escape scheme defines the properties that describe the text escaping rules. There are two variants on such schemes:

On parsing, the escape scheme is applied after padding characters are trimmed and on unparsing before padding characters are added.

DFDL does not provide a substitution mechanism similar to XML that would replace a character entity such as &lt; with its literal value <.

Property Name

Description

escapeKind

Enum

Valid values ‘escapeCharacter', 'escapeBlock'

The type of escape mechanism defined in the escape scheme

When ‘escapeCharacter’: On unparsing a single character of the data is escaped by adding an dfdl:escapeCharacter before it. The following are escaped if they are in the data

- Any in-scope terminating delimiter by escaping its first character.

- dfdl:escapeCharacter (escaped by dfdl:escapeEscapeCharacter)

- any dfdl:extraEscapedCharacters

On parsing the dfdl:escapeCharacter and dfdl:escapeEscapeCharacter' are removed from the data, unless the dfdl:escapeCharacter is preceded by the dfdl:escapeEscapeCharacter, or the dfdl:escapeEscapeCharacter does not proceed the dfdl:escapeCharacter.

When ‘escapeBlock’: On unparsing the entire data are escaped by adding dfdl:escapeBlockStart to the beginning and dfdl:escapeBlockEnd to the end of the data. The data is either always escaped or escaped when needed as specified by dfdl:generateEscapeBlock. If the data is escaped and contains the dfdl:escapeBlockEnd then first character of each appearance of the dfdl:escapeBlockEnd is escaped by the dfdl:escapeEscapeCharacter. On parsing the dfdl:escapeBlockStart is removed from the beginning of the data and dfdl:escapeBlockEnd is removed from end of the data and any dfdl:escapeEscapeCharacters are removed when they precede a dfdl:escapeBlockEnd.

Annotation: dfdl:escapeScheme

escapeCharacter

DFDL String Literal or DFDL Expression

Specifies one character that escapes the subsequent character.

Used when dfdl:escapeKind = ‘escapeCharacter’

It is a schema definition error if dfdl:escapeCharacter is empty when dfdl:escapeKind is ‘escapeCharacter’

This property can be computed by way of an expression which returns a character. The expression must not contain forward references to elements which have not yet been processed.

Escape characters contribute to the representation length of the field

Annotation: dfdl:escapeScheme

escapeBlockStart

DFDL String Literal

The string of characters that denotes the beginning of a sequence of characters escaped by a pair of escape strings.

Used when dfdl:escapeKind = ‘escapeBlock’

It is a schema definition error if escapeBlockStart is empty when dfdl:escapeKind is ‘escapeBlock’

An dfdl:escapeBlockStart string contributes to the representation length of the field

Annotation: dfdl:escapeScheme

escapeBlockEnd

DFDL String Literal

The string of characters that denotes the end of a sequence of characters escaped by a pair of escape strings.

Used when dfdl:escapeKind = ‘escapeBlock’ .

It is a schema definition error if dfdl:escapeBlockEnd is empty when dfdl:escapeKind is ‘escapeBlock’

A dfdl:escapeBlockEnd string contributes to the representation length of the field

Annotation: dfdl:escapeScheme

escapeEscapeCharacter

DFDL String Literal or DFDL Expression

Specifies one character that escapes the subsequent escape character or first character of dfdl:escapeBlockEnd.

Used when dfdl:escapeKind = ‘escapeCharacter’ or ‘escapeBlock’.

This property can be computed by way of an expression which returns a character. The expression must not contain forward references to elements which have not yet been processed.

If the empty string is specified then no escaping of escape characters occurs.

It is explicitly allowed for both the dfdl:escapeCharacter and the dfdl:escapeEscapeCharacter to be the same character. In that case processing functions as if the dfdl:escapeCharacter escapes itself.

Annotation: dfdl:escapeScheme

extraEscapedCharacters

List of DFDL String Literals

A space separated list of single characters that must be escaped in addition to the in-scope delimiters.

This property only applies on unparsing

Annotation: dfdl:escapeScheme

generateEscapeBlock

Enum

Valid values ‘always’, ‘whenNeeded’

Controls when escaping is used on unparsing when dfdl:escapeKind is ‘escapeBlock’.

If ‘always’ then escaping is always occurs as described in dfdl:escapeKind.

If ‘whenNeeded’ then escaping occurs as described in dfdl:escapeKind when the data contains any of the following :

any in-scope terminating delimiter

dfdl:escapeBlockStart at the start of the data

any dfdl:extraEscapedCharacters

Annotation: dfdl:escapeScheme


Copyright (C) Open Grid Forum (2005-2010). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the OGF or other organizations, except as needed for the purpose of developing Grid Recommendations in which case the procedures for copyrights defined in the OGF Document process must be followed, or as required to translate it into languages other than English.