Versions Compared

Key

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

...

Record Nodes represent records in the file. Record Nodes can be specified as target nodes, which will generate output records of the File Collector (see 4)

Record Nodes are made up of a collection of nodes, of various types. The Attribute Nodes under a Record Node generate the File Columns in the output records of the File Collector.

In addition to common attributes (see 3.1) Record  Record Nodes may have the following attributes:

Attribute name

Description

Possible Values

Mandatory

Default

prefix

If the Record Node has a child Name Node (see 3.4.5), 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 (see 3.4.3) , 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 3.4.2 Attribute Node for details of the discriminator attribute.

Any:

  • string, or
  • hex string, e.g A0FF08, if the hexDiscriminator attribute is set to T.

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:

  • a number (the number of bytes)
  • a variable name, the variable holding the number of bytes – this variable must have been declared in the variables attribute of this or an ancestor node
  • an Expression inside curly braces which will calculate a whole number. The Expression may refer to Attribute Nodes which have been declared in the scriptVariables attribute of this or an ancestor node.

No

None

...

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.

An Attribute Node may have child nodes. For example, ASN.1 files have fields which consist of a tag value, followed by a length value, followed by the actual value of the field. This can be expressed in a grammar by placing child Tag, Length and Value (or Bytes) Nodes inside the Attribute Node.

If an Attribute Node has a child Value or Bytes Node then it will not itself read any data from the file, but will instead take its value from the Value or Bytes Node. In this case the bytes, bits, type, stringType, byteOrder and nibbleOrder attributes on the Attribute Node will merely act as defaults for the child Value or Bytes Node (although these defaults can be overridden by the child node if any of these attributes are set on the child node itself).

In addition to common attributes (see 3.1) Attribute  Attribute Nodes may have the following attributes:

Attribute name

Description

Possible Values

Mandatory

Default

prefix

If the Attribute Node has a child Name Node (see 3.4.5), 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:

  • string, or
  • hex string, e.g A0FF08, if the hexDiscriminator attribute is set to T.
    Note that the file reader will expect the minimum number of bytes required to hold the value of the discriminator. E.g. if the discriminator is the number 2, the file reader will expect a single byte. If the field uses more than the minimum number of bytes, specify the full value of the discriminator as a hex string. E.g. the discriminator is the number 2, but is represented in the file with 4 bytes, padded with leading 0s; the discriminator would be "00000002".

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:

  • a number (the number of bytes)
  • a variable name, the variable holding the number of bytes – this variable must have been declared in the variables attribute of this or an ancestor node
  • an Expression inside curly braces which will calculate a whole number. The Expression may refer to Attribute Nodes which have been declared in the scriptVariables attribute of this or an ancestor node.

    This attribute is not mandatory if any of:
  • the discriminator attribute is set, since the number of bytes can be determined directly from the discriminator
  • this node has a child Value or Bytes Node with bytes attribute set
  • the bits attribute is set
  • this node has a child Length Node
  • this node has a preceding sibling Length Node

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:

  • a number (the number of bytes)
  • a variable name, the variable holding the number of bits – this variable must have been declared in the variables attribute of this or an ancestor node
  • an Expression inside curly braces which will calculate a whole number. The Expression may refer to Attribute Nodes which have been declared in the scriptVariables attribute of this or an ancestor node.

    This attribute is not mandatory if any of:
  • the discriminator attribute is set, since the number of bits can be determined directly from the discriminator
  • this node has a child Value or Bytes Node with bits attribute set
  • the bytes attribute is set
  • this node has a child Length Node
  • this node has a preceding sibling Length Node

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:

  • BCD - the field is a binary coded decimal. Commonly used for telephone numbers where each byte contains two numerals, each numeral represented by 4 bits. The result is returned as a string.
  • Integer - a standard integer.
  • String - a string.
  • Float - a floating point number. This type assumes that the number has been encoded as a string which needs to be converted to a float.
  • DateTime - a date and time. This type assumes that the date and time have been encoded as a string which needs to be converted to a date and time.
  • Date - a date. This type assumes that the date has been encoded as a string. The string may include a time component but this will be set to zero (midnight) in the output.
  • BERTag – the field is encoded as an ASN.1 tag in BER format. You do not need to specify a number of bytes for a BERTag field since the length is encoded as part of the data.
  • BERLength - this node is an ASN.1 length value encoded in BER format. You do not need to specify a number of bytes for a BERLength attribute since the length is encoded as part of the data.
    The type you specify in the grammar is not case sensitive, e.g. it can be "STRING", "String" or "string".

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. E.g. UTF8

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 (3.4.3).
This setting dictates how the tag value is translated.

Any of:

  • Universal
  • Application
  • Context
  • Private
    The tagType you specify in the grammar is not case sensitive, e.g. it can be "CONTEXT", "Context" or "context".

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 (3.4.3).

T for true or F for false

No

F

...