IBM Version 5 Universal Remote User Manual


 
124 The XML Files: Development of XML/XSL Applications Using WebSphere Studio
<restriction base="string">
<length value="30"/>
</restriction>
</simpleType>
</element>
<element name="AIRCRAFT">
<simpleType>
<restriction base="string">
<length value="10"/>
</restriction>
</simpleType>
</element>
<element name="DEPARTURE">
<simpleType>
<restriction base="string">
<length value="10"/>
</restriction>
</simpleType>
</element>
<element name="ARRIVAL">
<simpleType>
<restriction base="string">
<length value="10"/>
</restriction>
</simpleType>
</element>
</sequence>
</complexType>
</schema>
For the tables that we have used in our example, the schemas generated are
quite simple. Here we generated a schema for the SCHEDULE table. The main
element is named as SCHEDULE after the table, and our key here is just the
flightNo. All the attributes within the table are held within a complexType element,
the attributes themselves have been generated as elements. Notice that a
<sequence> element has not been enforced on the order of the columns in the
XML Schema.
In this example, the foreign key from the Aircraft column to the AIRCRAFT table
has not been given any extra attention. It appears just like another column in the
table. When a XML Schema is generated for the AIRCRAFT table, the XML
Schema does not show any relationship with the SCHEDULE XML Schema.
An alternative to this method of generating a schema from a table would be to
use a select statement. Looking at Figure 5.1, showing the Passenger List
statement, one could create a select statement just on the SCHEDULE table.