Command Line Interface

Previous Menu Next

The XBinder XML data binding tool can be invoked simply by running its executable image or binary directly from a command prompt. After the command you specify the .xsd file or files you want to compile into source code. And after the files you specify qualifiers. The qualifiers start with a hyphen ("-"). Some qualifiers take arguments; others don't.

Detailed information on the XBinder command line interface is available in the XBinder documentation. The documentation can either be downloaded as PDF files or viewed online.

As an example, suppose our purchase record schema that we saw previously is contained in a file called Purchase.xsd. And suppose we want to generate C code from this schema. A command to do this generation might be this:

        
         > xbinder Purchase.xsd -c
        
       

There are some command line qualifiers that are useful regardless of what language you're using for your generated code. We'll look at some of these now, and then look at other qualifiers that are specific to the languages when we examine how to generate code for each language. The table below is not an exhaustive list of all the command line qualifiers.

Qualifier Description
-config <file> Specifies a configuration file. A configuration file is an XML file that contains information telling XBinder how to handle situations that might be encountered during the compilation. The XBinder documentation discusses the format of the configuration file and what options are available in it. This tutorial will not discuss configuration files further.
-genmake Generate a makefile (or, in the case of Java, an Ant script) to build the generated code.
-genreader Generates a sample program that shows how to decode an instance that follows the schema being compiled.
-genwriter Generates a sample program that shows how to encode an instance that follows the schema being compiled.
-I <directory> Specifies a directory that will be searched for XSD <import> and <include> items.
-o <directory> Specifies a directory where the generated code will be written.
-print Generate print functions. These functions allow the contents of a generated structure or class to be written to the standard output device and are useful for debugging.
-w32 Indicates that the code should be generated so that it can be built and run on Windows. Also influences the format of a makefile if -genmake is specified.

 

Previous Menu Next