The XSD-to-ASN.1 translation tool is the xsd2asn1 utility program that can be found in the bin subdirectory of an ASN1C installation. To test if the compiler was successfully installed, enter xsd2asn1 with no parameters as follows (note: if you have not updated your PATH variable, you will need to enter the full pathname):
xsd2asn1
You should observe the following display (or something similar):
XSD2ASN1, Version 0.2.x Copyright (c) 2005 Objective Systems, Inc. All Rights Reserved.
Usage:
xsd2asn1 <filename> options
<filename> XML schema or WSDL source file name(s). Multiple filenames may be specified. * and ? wildcards are allowed.
options:
-config <file> Specify schema bindings file -o <directory> Output file directory -I <directory> Import file directory -all Compile all dependent files -warnings Output compiler warning messages
The XSD source file specification can be a full pathname or only what is necessary to qualify the file. If directory information is not provided, the user's current default directory is assumed. Multiple source filenames may be specified on the command line to compile a set of files. The wildcard characters `*' and `?' are also allowed in source filenames (for example, the command `xsd2asn1 *.xsd' will translate all XSD files in the current working directory to ASN.1).
The following table lists all of the command line options supported in this version of the tool.
Option | Argument | Description |
---|---|---|
-all | None | This option is used to specify that all dependent files should be translated to ASN.1 as well as the main file being compiled. This includes all files included using XSD <include> and <import> directives. |
-config | <filename> | This option is used to specify the name of a file containing configuration information for the source file(s) being parsed. A full discussion of the contents of a configuration file is provided in the XML Schema Binding File section. |
-I | <directory> | This option is used to specify a directory that the compiler will search for ASN.1 source files for IMPORT items. Multiple -I qualifiers can be used to specify multiple directories to search. |
-o | <directory> | This option is used to specify the name of a directory to which all of the generated files will be written. |
-warnings | None | Output information on compiler generated warnings. |