Thoughts on the current state of ASN.1 and XML technologies.

ASN.1 Tag Path Filtering in ASN2TXT


The latest release of our ASN.1 to Text Translation Tool (ASN2TXT) contains a new feature called “tag path filtering”. The purpose of this is to allow users to target specific items within a BER-encoded message without the need for full ASN.1 schema information. One use case for this would be the case where a user has a Call Detail Record (CDR) specification which has snippets of ASN.1 code, but which does not have the full specification. Another use case is where the user has the full specification, but is only interested in accessing a few specific items within the encoded data.

The way it works is the “tag path” to specific elements within the message is specified in an XML file along with other information such as the data type of the item and names to be used. The tag path is a concatenated list of ASN.1 tag values using a special compact syntax. So instead of using the full name for a tag such as [UNIVERSAL 22], only the first letter of the tag class would be used and there would be no space between the letter and the tag number. Therefore, [U22] would be the shorthand name for this tag.

In addition to the tag path, the following items can be used in a tag path specification:

  • name – a name that will be used in some types of output formats in place of the generated tag name.
  • type – the data type of the element used to format the value for output.
  • value – a textual value that would replace the actual data at the tag location.

The specification of a complete tag path is expressed in XML as follows:

<asn1TagPath>
  <path> path in tag path format </path>
  <name> name of the element </name>
  <type> data type of the element </type>
  <value> value to use for the element </value>
</asn1TagPath>

A tag path filter consists of one or more of these elements wrapped in an <asn1TagFilter> element.

This is just a brief summary of the basic idea behind tag paths. Full details can be found in the ASN2TXT User’s Manual in the section on ASN.1 Tag Path Filtering.

Comments are closed.