
XML Schemas • 157
Therefore, our diagram would now change as shown in Figure 4.19.
In the schema, PersonType is composed of NAME, which, in turn is made up of
FIRST_NAME and LAST_NAME, as shown below.
<xsd:complexType name = “PersonType”>
<xsd:sequence>
<xsd:element name = “NameType”>
<xsd:complexType>
<xsd:sequence>
<xsd:element name = “FIRST_NAME” type = “xsd:string”/>
<xsd:element name = “LAST_NAME” type = “xsd:string”/>
</xsd:sequence>
</xsd:complexType>
</xsd:sequence>
</xsd:complexType>
Later in the schema, PersonType is now used correctly.
<xsd:complexType name = “EmpType”>
<xsd:sequence>
…
<xsd:element name = “PROJECT” type = “xsd:string” ...