Menu

Flattener

Andrew Forsyth

JBerd Flattener

The purpose of the Flattener is to convert complex input BER encoded structures into simple flat ASCII records for downstream consumption. Much of the complexity here arises from the question of how to handle repeating elements.

Mapping specification

As well as an input BER file, the flattener takes an input XML file called a mapping specification, which indicates the following:

  • Which input BER structures should trigger a new record to be written.
  • Which output fields should be written.

For example, our input file may consist of CALL_RECORD structures, and each CALL_RECORD may contain a CALLER and a CALLED_PARTY. A Mapping specification may look something like this:

<OUTPUT>
  <RECORD TRIGGERALIAS="CALL_RECORD">
     <FIELD TRIGGERALIAS="CALLER"/>
     <FIELD TRIGGERALIAS="CALLED_PARTY"/>
  </RECORD>
</OUTPUT>

This will produce a comma separated file containing the caller and called party from each call record.

The RECORD element's TRIGGERALIAS tells it what triggers a record to be written. In this case an output record will be triggered by the end of each CALL_RECORD.

Similarly the TRIGGERALIAS of the FIELD elements indicates that the occurrence of a CALLER or CALLED_PARTY item in the input will cause the fields to be populated.

Quite complex manipulations of the input data are possible using the simple specification. For instance, a subset of an input BER file could be translated to XML format. See documentation for more details.

Further Information

To see how alias names are associated with BER data items see [Tags and Aliases]

For full documentation see Jberd.pdf


Related

Wiki: Home
Wiki: Tags and Aliases

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.