ASN2XSD
ASN.1 to XSD Translator
The ASN2XSD ASN.1 to XSD application translates ASN.1 source specifications into equivalent XML schema (XSD) specifications. There is no standard for this translation. It is done as documented in the ASN2XSD User's Manual.
A simple example of the type of translation that is done is as follows:
Employee DEFINITIONS ::= BEGIN ContactInfo ::= SEQUENCE { name UTF8String, age INTEGER, email IA5String OPTIONAL } END
This defines a Person structure with three fields:
- name (UTF8String)
- age (INTEGER)
- email (IA5String, optional)
Equivalent XML Schema (XSD):
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Person"> <xs:complexType> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="age" type="xs:int"/> <xs:element name="email" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The following translations from ASN.1 data types to XSD types were done:
- UTF8String → xs:string
- INTEGER → xs:int
- IA5String (ASCII string) → xs:string
Optional Fields
In ASN.1, email is optional.
In XSD, minOccurs="0" makes email optional.
Structure
ASN.1 SEQUENCE maps to xs:complexType with xs:sequence.
XSD to ASN.1
The package also includes the xsd2asn1 tool for translating from XSD to ASN.1. This does the translation as per the X.694 standard.
ASN2XSD Web Service
The product may be tried out online by going to the following URL:
The online version can be used freely on ASN.1 specifications up to 800 lines in length with no imports. For larger specifications, a subscription to the service must be purchased. This includes access to the command-line tool for use within your local development environment. Click the button below to subscribe to the service: