From there, using the XML from SQL wizard, the user has a few options on how to create the XML Schema. The example below was created with the Show tables as Primary keys as attributes:

Example 6-11 XML Schema for a single table using a Select

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

<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com/SCHEDULE"

xmlns:SCHEDULE="http://www.ibm.com/SCHEDULE"> <element name="SQLResult">

<complexType>

<sequence>

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

</sequence>

</complexType>

<key name="SCHEDULEPRIMKEY">

<selector xpath="SCHEDULE:SCHEDULE"/> <field xpath="@FLIGHTNO"/>

</key>

</element>

<element name="SCHEDULE"> <complexType>

<sequence>

<element ref="SCHEDULE:AIRCRAFT"/> <element ref="SCHEDULE:DEPARTURE"/> <element ref="SCHEDULE:ARRIVAL"/>

</sequence>

<attribute name="FLIGHTNO"> <simpleType>

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

</restriction>

</simpleType>

</attribute>

</complexType>

</element>

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

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

</restriction>

</simpleType>

</element>

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

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

Chapter 6. RDB and XML integration 125

Page 141
Image 141
IBM Version 5 manual Example 6-11 XML Schema for a single table using a Select