OPTIONAL and DEFAULT Elements

Optional primitive elements that are missing in an input message will result in a blank entry in the output CSV file. Take, for example, the following specification:

   A ::= SEQUENCE {
      a INTEGER,
      b UTF8String OPTIONAL,
      c BIT STRING
   }                 
         

This might result in the following output:

   a,b,c
   1,test string,100100
   2,,100101
   3,another test,100100         
         

In this example, the second message does not contain the optional UTF8String element, so it is omitted from the output.

Elements marked DEFAULT are handled differently in the output. If an element is missing in the input specification, the default value is copied into the output CSV file. The following specification is used to demonstrate:

   A ::= SEQUENCE {
      a INTEGER,
      b UTF8String DEFAULT "test",
      c BIT STRING
   }                 
         

In this case, we might have the following output:

   a,b,c
   1,test string,100100
   2,test,100101
   3,another test,100100         
         

Like the previous example, the input data omitted the default UTF8String. Instead of a blank entry, however, the output CSV data contains test.