For some time, ASN1C has supported two XML-based encoding rules and associated runtimes. One of these we have simply called "XER" and the other (perhaps confusingly) "XML". "XER" stands for XML Encoding Rules, as specified in X.693. What we have called "XML" we might have called (and will call here) OSys-XER, standing for Objective Systems' XML Encoding Rules, since we basically defined our own variation of XER. The XER decoders used SAX based parsing while the OSys-XER decoders used a proprietary XML pull parser.

As of version 6.5.1, these two approaches have been merged together. We now use the "XML" runtime for both XER and OSys-XER. Also, the generated code now supports both XER and OSys-XER at the same time, using a context flag (OSASN1XER) as a signal (to both the generated code and the runtime layer) to indicate which set of encoding rules should be followed. Thus, you can now choose at runtime which set of encoding rules to use. The differences between the encoding rules are documented here.

An additional advantage of the consolidation is that table constraint support is now available for XER (it was previously available only for OSys-XER). (Note that only the new style of table constraint support is supported: you must use -table-unions and not -tables.)

If need be, the old "XER" style of code can still be generated using -compat 649, but you are strongly encouraged to migrate to the new, consolidated style. The changes required to your code to upgrade should be relatively minimal and some tips for doing this have been included in our documentation, for both encoding and decoding.

As a result of this consolidation, compiling ASN.1 using "-xer" or "-xml" yields essentially the same result. The only difference is that the generated PDU encode/decode functions will set OSASN1XER for you, if you generate code using "-xer".


Published

Category

ASN1C