IBM Version 5 Universal Remote User Manual


 
Chapter 7. Generators 153
To generate the JavaBeans from the schema follow the next steps:
1. Select
passengerList.xsd.
2. Right-click Generate—>JavaBeans.
3. Enter the container created before.
4. Enter a name for the package.
5. Select
Flight as the root element.
6. Select
Generate sample test program. Click Finish.
Figure 7-6 is showing the generated Java codes.
Figure 7-6 JavaBeans from schema
Take a few minutes to review the generated code, you will notice that some
classes extend
ComplexType corresponding to main elements, and the other
classes extend SimpleType corresponding to sub elements. Try to run the
sample application to follow how it builds the XML file.
7.5 Generate XML/XSL from JavaBeans
You can generate Web pages that can access JavaBeans using XSL. For this
section we are going to use the JavaBean showed in Example 7-4. We create
this Java file in our Travel Web Project and the package is
airline.
Example 7-4 passenger.java
package airline;
/**
* @author osamurs2
*