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


13.7 Properties Specific to Numbers with Binary representation

These properties are applicable to decimals types and its derived types. These properties are not applicable to types float and double. See section 13.8 Properties Specific to Float/Double with Binary representation

Property Name

Description

binaryNumberRep

Enum

Valid values are ‘packed’, ‘bcd’, 'binary'

Allowable values for each number type are

type Permitted value
Decimal, Integer, nonNegativeInteger packed, bcd, binary
Long, Int, Short, Byte packed, binary

UnsignedLong,

Unsignedint,

UnsignedShort,

UnsignedByte
packed, bcd, binary

‘packed’ means represented as a packed decimal. In the packed decimal format, each byte contains two decimal digits, except for the least significant byte, which contains a sign in the least significant nibble.

‘bcd’ means represented as a binary coded decimal with two digits per byte.

‘binary’ means represented as twos complement for signed types and unsigned binary for unsigned types.

Annotation: dfdl:element, dfdl:simpleType

binaryDecimalVirtualPoint

Integer.

Used when base simpleType is xs:decimal.

An integer that represents the position of an implied decimal point within a number, or specify 0.

If you specify 0 then there is no virtual decimal point

If you specify a positive integer, the position of the decimal point is moved left from the right side of the number. For example, if you specify 3, the decimal value 1234 represents 1.234

If you specify a negative integer, the position of the decimal point is moved right from the right side of the number. For example, if you specify -3, the decimal value 1234 represents 1 234 000

Annotation: dfdl:element, dfdl:simpleType

binaryPackedSignCodes

List of Character

Used only when dfdl:binaryNumberRep or dfdl:binaryCalendarRep is ‘packed’

A space separated string giving the hex sign nibbles to use for a positive value, a negative value, an unsigned value, and zero.

Valid values for positive nibble: A, C, E, F

Valid values for negative nibble: B, D

Valid values for unsigned nibble: F

Valid values for zero sign: A C E F 0

Example: ‘C D F C’ – typical S/390 usage

Example: ‘C D F 0’ – handle special case for zero

On parsing, whether to accept all valid values for a positive, negative or unsigned number, and for zero, is governed by the dfdl:binaryNumberCheckPolicy property. On unparsing, the specified values are always used.

Annotation: dfdl:element, dfdl:simpleType

binaryNumberCheckPolicy

Enum

Values are 'strict' and 'lax'.

Indicates how lenient to be when parsing binary numbers.

If ‘lax' then the parser tolerates all valid alternatives where such alternatives exist. Specifically, for dfdl:binaryNumberRep = 'packed' the sign nibble for positive, negative, unsigned and zero is allowed to be any of the valid respective values.

On unparsing, the specified value is always used

Annotation: dfdl:element, dfdl:simpleType

13.7.1 Converting logical numbers to/from binary representation


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.