Getting Started with C or C++ Sample Programs
To begin using XBinder to generate C source code, one should start with the sample programs. These are located in the c/sample or cpp/sample subdirectories of the installation. A good sample program to get started with is the Employee sample program. This program contains an XML schema file that describes an employee personnel record.
To run this sample program from the command-line interface, the following procedure should be followed:
cd c/sample/Employee
Note: this assumes the starting point is the XBinder installation root directory.
Note: nmake is a make utility program that comes with the Microsoft Visual C++ compiler. It may be necessary to execute the batch file vcvars32.bat that comes with Visual C++ in order to set up the environment variables to use this utility.
4. This should cause the XBinder compiler to be invoked to compile the employee.xsd XML schema file. It will then invoke the configured C compiler to compile the generated C file and test drivers. The result should be a writer.exe and reader.exe program file which, when invoked, will encode and decode a sample employee record.
6. This will generate an encoded record and write it to a disk file. By default, the file generated is message.xml. The test program has a number of command line switches that provide encoding options. To view the switches, enter writer ? and a usage display will be shown.
8. This will read the disk file that was just created by the writer program and decode its contents. The resulting decoded data will be written to standard output. The test program has a number of command line switches that provide decoding options. To view the switches, enter reader ? and a usage display will be shown.
Copyright © Objective Systems 2002-2008 This document may be distributed in any form, electronic or otherwise, provided that it is distributed in its entirety and that the copyright and this notice are included. |
Objective Systems, Inc.55 Dowlin Forge RoadExton, Pennsylvania 19341 http://www.obj-sys.com Phone: (484) 875-9841 Toll-free: (877) 307-6855 (US only) Fax: (484) 875-9830 info@obj-sys.com |