<element name="SQLResult"> <complexType>

<sequence>

<element maxOccurs="unbounded" minOccurs="0" ref="AIRCRAFT:AIRCRAFT"/>

</sequence>

</complexType>

<key name="AIRCRAFTPRIMKEY">

<selector xpath="AIRCRAFT:AIRCRAFT"/> <field xpath="@AIRCRAFT_KEY"/>

</key>

</element>

<element name="AIRCRAFT"> <complexType>

<sequence>

<element ref="AIRCRAFT:TYPE"/> </sequence>

<attribute name="AIRCRAFT_KEY"> <simpleType>

<restriction base="string"> <maxLength value="10"/>

</restriction>

</simpleType>

</attribute>

</complexType>

</element>

<element name="TYPE" nillable="true"> <simpleType>

<restriction base="string"> <maxLength value="30"/>

</restriction>

</simpleType>

</element>

</schema>

DTD file

The Schema definition can also be generated as a DTD. Here we will compare the DTD generated by each of the options. With the Show table columns as ‘Elements’ option, the following DTD is generated:

Example 6-5 DTD generated by the Show table as ‘Elements’ option

<?xml version="1.0" encoding="UTF-8"?>

<!ELEMENT SQLResult (PASSENGER_SCHEDULE_AIRCRAFT)*>

<!ELEMENT PASSENGER_SCHEDULE_AIRCRAFT (FLIGHT,NAME,MEMBERSHIP,AIRCRAFT,DEPARTURE,ARRIVAL,TYPE) >

Chapter 6. RDB and XML integration 115

Page 131
Image 131
IBM Version 5 manual DTD file