
9.2.4 Creating DAD file using RDB to XML mapping
After defining the schema for the output message and setting our database, we can define the listPassenger operation that retrieves the information from the database. Here we plan to use the DB2 XML Extender
The Document Access Definitions (DAD) file, is an XML formatted document, it is used to associate the XML document structure to a DB2 database. Basically, it provides the mapping between the elements or attributes of an XML document and the table columns, and the details of how a request for an XML document is to be handled.
To see how to map the database to the DTD file see Figure
Schedule | DTD |
flightNo | <flight> |
aircraft | <flightNo> |
departure | <departure> |
arrival | <Customer> |
| <name> |
| <membership> |
Passenger |
|
flight |
|
name |
|
membership |
|
Figure 9-14 RDB to XML mapping
The RDB to XML Mapper tool, shown in Figure
1.Turn to XML perspective if necessary.
2.Select the project and
3.Enter passengerList.rmx as the name of the file, click Next.
4.Select RDB Table to XML Mapping, click Next.
5.Select the source tables Passenger and Schedule, click Next.
6.Then select the target DTD file passengerList.dtd, select Flight as the root element, and click Finish.
196 The XML Files: Development of XML/XSL Applications Using WebSphere Studio