XML Schema specifies 44 built-in types, 19 of which are primitive.
The 19 built-in primitive types are listed below.
The other 25 built-in data types are derived from one of the primitive types listed above.
A simple-type element is defined using the
<?xml version="1.0" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Author"> <xs:complexType> <xs:sequence> <xs:element name="FirstName" type="xs:string"/> <xs:element name="LastName" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
LastName elements in the code sample above. They are not explicitly defined as simple type elements. Instead, the type is defined with the
type attribute. Because the value (
string in both cases) is a simple type, the elements themselves are simple-type elements.
Author element is a complex-type element. Complex-type elements will be covered later in the course.