EXTENDED-XER (specified in X.693) allows you to vary the XML encoding of ASN.1 by using XER encoding instructions. For some time, ASN1C has supported EXTENDED-XER indirectly by allowing you to directly compile XSD. When compiling XSD, ASN1C does an implicit transformation to ASN.1 with XER encoding instructions, as specified in X.694. As of version 6.5.1, we now partially support EXTENDED-XER when compiling ASN.1 having XER encoding instructions.

If your ASN.1 contains XER encoding instructions, ASN1C will automatically generate code for EXTENDED-XER instead of BASIC-XER. This is true whether you use -xer or -xml on the command line. If, however, any unsupported encoding instructions are found, ASN1C will ignore all XER encoding instructions, since it would not be capable of supporting EXTENDED-XER for that specification.

ASN1C currently (as of v6.5.1) supports the ATTRIBUTE and BASE64 instructions. The ATTRIBUTE instruction causes a component of a sequence to be encoded as an XML attribute. The BASE64 instruction causes octet strings to be encoded in a base64 representation, rather than in a hexadecimal representation.

Working with code generated for EXTENDED-XER is essentially the same as working with code for BASIC-XER. The details vary a little here, depending on whether you are working with C, C++, Java, or C#. Refer to our documentation for details on this, and also for a discussion of the limitations to our EXTENDED-XER support (see here for C/C++; here for C#; here for Java)

You can see EXTENDED-XER in action using the Employee EXER sample program, available for C, C++, Java, and C#.

We'd like to hear about how you are using EXTENDED-XER, and what other XER instructions you would really like to see supported. You can post a comment here, or send email to support@obj-sys.com.


Published

Category

ASN1C