...
Attribute name | Description | Possible Values | Mandatory | Default |
prefix | If the Record Node has a child Name Node, setting this attribute will apply the value of the attribute, followed by an underscore, as a prefix to the name read from the file into the Name Node. This can be useful if the value read can start with a number, or other value which would be invalid when used in a PhixFlow Attribute Expression. | Any string | No | None |
discriminator | If a record has a child Tag Node, then this string will be used as the discriminator for the Tag Node, unless a discriminator is also set on the Tag Node itself, which will override it. See Attribute Node for details of the discriminator attribute. | Any:
| No | None |
hexDiscriminator | Whether the discriminator will be given as a hex string. If the discriminator cannot be specified as an ASCII string then it can be specified as a hex string, where each pair of characters in the string represent a hex digit. | T for true or F for false | No | F |
length | This overall length, as number of bytes, expected for all Attribute Nodes within the hierarchy of the Record Node. This is helpful if the fields that make up the record in the file include optional fields – setting the length helps the grammar to determine where the record ends. | Any of:
| No | None |
Attribute Node
...
An Attribute Node (and each of its five subtypes: Tag Nodes; Length Nodes; Name Nodes; Value Nodes; Bytes Nodes) are the only grammar nodes that will make the file reader read bytes from the file.
...
Attribute name | Description | Possible Values | Mandatory | Default |
prefix | If the Attribute Node has a child Name Node, setting this attribute will apply the value of the attribute, followed by an underscore, as a prefix to the name read from the file into the Name Node. This can be useful if the value read can start with a number, or other value which would be invalid when used in a PhixFlow Attribute Expression. | Any string | No | None |
discriminator | The discriminator specifies the full value of this field (i.e. the field represented by this Attribute Node) in the file. The discriminator will be converted, according to the type attribute, into the bytes that will be read in the file when this field is found. The discriminator can be used to determine whether optional fields are included in the file. | Any:
| No | None |
hexDiscriminator | Whether the discriminator will be given as a hex string. If the discriminator cannot be specified as an ASCII string then it can be specified as a hex string, where each pair of characters in the string represent a hex digit. | T for true or F for false | No | None |
bytes | The number of bytes to be read from the file for this field. | Any of:
| No, in certain cases (see notes in Possible Values column) Otherwise yes. | None |
bits | The number of bits to be read from the file. This value will take precedence over the number of bytes if both are specified. | Any of:
| No, in certain cases (see notes in Possible Values column) Otherwise yes. | None |
type | The type of the field to be read. This attribute dictates how the bytes read from the file will be converted. | Any of:
| No, if this node has a child Value or Bytes Node, with the attribute type set. Otherwise yes. | None |
dateFormat | The format of a date in the file. This should only be set if the type has been set as Date or DateTime. If no date format is specified then the reader will try a variety of possible date formats in turn. It is therefore more efficient to specify a date format, if possible. | A valid date format string. Valid date formats are documented in the PhixFlow online help. | No | None |
stringType | This character set to use when converting the bytes read from the file into a string, or converting a discriminator value into the bytes that will be read in the file. | Any string which specifies a valid Java character set, such as UTF8 (or for MariaDB MySQL UTF8mb3). | No | Taken from Grammar Node |
byteOrder | The order that bytes will be read from the file when converting into a value. | L (for little endian) or B (for big endian). | No | Taken from Grammar Node |
nibbleOrder | The order that nibbles (4 bit blocks) will be read from the file when converting into a value. | L (for little endian) or B (for big endian). | No | Taken from Grammar Node |
tagType | If this grammar is for an ASN.1 file and this node is for a tag value – the type of tag. The ASN.1 definition document that describes the file using ASN.1 notation should specify the type of each tag. If not, see the notes at the end of the Tag Node description. This setting dictates how the tag value is translated. | Any of:
| No | Context |
berConstruct | If this grammar is for an ASN.1 file and this node is for a tag value - this flag indicates whether the tag is for a constructed value (i.e. a record with sub values) or a simple value. The ASN.1 definition document that describes the file using ASN.1 notation should specify whether this tag is for a construct variable. If not, see the notes at the end of the Tag Node description. | T for true or F for false | No | F |
Tag Node
...
The Tag Node is a sub type of the Attribute Node. It has the same attributes as the Attribute Node, and will read bytes from the file to calculate a tag value.
...
Code Block | ||
---|---|---|
| ||
<Tag name="hexTag" type="Integer" discriminator="A5" hexDiscriminator="T"/> |
Length Node
...
The Length Node is a sub type of the Attribute Node. It has the same attributes as the Attribute Node, and will read bytes from the file to obtain a length value.
...
If a Length Node sets the length on a Sequence or Record Node, then the length determines how many bytes are expected across all remaining child Attribute Nodes of that Record or Sequence Node after the Length Node (i.e. not including any child Attribute Nodes before the Length Node). See Control Nodes Attributes.
Name Node
...
...
The Name Node is a sub type of the Attribute Node. It has the same attributes as the Attribute Node, and will read bytes from the file to obtain a name.
...
If more than one Name Node is specified then the second and subsequent Name Nodes will append an underscore, followed by the value of the Name Node, to the end of the name created by the first Name Node.
Value Node
...
...
The Value Node is a sub type of the Attribute Node. It has the same attributes as the Attribute Node, and will read bytes from the file to calculate a value.
...
If the bytes, bits, type, stringType, byteOrder and nibbleOrder attributes are not set on a Value Node then the corresponding attributes on the most immediate Attribute Node ancestor will apply. Just as for Tag Nodes inheriting discriminators, this is useful when creating reusable templates (see Tag Node). Rather than specifying these attributes in the template, they can be set on the Attribute Nodes that use the template. These attribute values will be inherited by the child nodes copied from the template. In this way the same template can be used for a range of Integer, String or BCD attributes with different byte, nibbleOrder, etc. attributes.
...
The same technique could be used to convert strings to Integers, Floats, Dates or DateTimes.
Bytes Node
...
The Bytes Node is a sub type of the Attribute Node. It has the same attributes as the Attribute Node, and will read bytes from the file to obtain a value.
...