11.3 Developing the customer registration sample

We are going to reuse customer registration sample code that we developed in previous chapter. In order to develop this application, modify CustomerXSL servlet and XSLs:

￿Re-generate all related files from customer bean.

￿Modify the CustomerXSL servlet to allow storage and retrieval of customer data.

11.3.1Adding the libraries to the project

You need to add two libraries to your project. Use the property window of the project. Two variables are defined in Application Developer. To add the jars to the classpath, use add variable button, and add XMLTOSQL and SQLTOXML. For your information, the jars are located under the following directories:

XMLToSQL plugins\com.ibm.etools.sqltoxml_5.0.0\jars\xmltosql.jar

SQLToXML plugins\com.ibm.etools.sqltoxml_5.0.0\jars\sqltoxml.jar

11.3.2 XML Document format

One thing to be aware of is that the XML format is not compatible with our customerXSL. The following XML is a sample that the libraries accept:

<SQLResult>

<Customer>

<firstname>firstname</firstname>

<lastname>lastname</lastname>

<email>email</email>

<membership>membership</membership>

</Customer>

</SQLResult>

The document root is typically SQLResult. And the first child, in this case, Customer, is used as a table name, afterwards each column should follow (Figure 11-6).

262 The XML Files: Development of XML/XSL Applications Using WebSphere Studio

Page 278
Image 278
IBM Version 5 manual Adding the libraries to the project, XML Document format