Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress XML Binding Development Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

4.2 Generating Code from Schema

To generate the output for the schema describing the Purchase Order XML document:

  1. Follow the instructions in Chapter 2, "Setup," in the Introduction to HydraExpress to set up your environment.

  2. Open a command prompt and navigate to the directory installdir\tutorials\xmlbinding\namespace.

  3. Invoke the code generator as shown below:

  4. The HydraExpress project file example-project.xml provided as an argument specifies the schema po1.xsd, assigns a project name namespaceExample on which the code generation directory is based, and also includes the options to use SourcePro classes and to include whitespace when marshaling.

    This invocation is the same as entering the options and files directly on the command line as follows:


Note: SourcePro is not included with HydraExpress. It is a separate product from Rogue Wave Software and must be purchased separately.

For more information on the use of HydraExpress project files in shipped examples, see Section 1.5.1, "The Use of the HydraExpress Project File in Shipped Examples," in the Introduction to HydraExpress. For complete information about the command-line options, see Section 20.6, "Generator Options," in the HydraExpress Web Service Development Guide.


The example program in this section uses SourcePro C++ classes. The provided po1_main.cpp file will not compile if you use the -stl binding. The -sourcepro option is specified in the HydraExpress project file example-project.xml used as an argument above. For more information on the HydraExpress project file, see Section 21.3, "The Code Generation Directory," in the HydraExpress Web Service Development Guide.

4.2.1 Generator Output

The classes and other files generated for this example are the same as for the Basic example. For a description of the generated code generation directory structure and specific generated files, see Section 3.3.3, "Generated Files."

Note the generated file po1_main.cpp in the namespaceExample\app\data directory. You can create an application main by editing this file. Replace the TODO items with your application logic. Compile your application as described in Section 4.3.

This example description assumes use of the implemented version of po1_main.cpp located in the installdir\tutorials\xmlbinding\namespace directory. Copy the provided files po1_main.cpp and po1.xml into the namespaceExample\app\data directory before compiling.


Source code other than that in the app directory is not overwrite protected. You should never add business logic or make any other changes to the generated source code as these changes will be lost the next time the code is generated.


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.