Contact Us or call 1-877-932-8228


Complex-type elements have attributes, child elements, or some combination of the two. For example, the Name and HomePage elements below are both complex-type elements.

Code Sample:

<?xml version="1.0"?>

<!--Person element is a complex-type--->
		<!---FirstName and LastName elements have simple text--->
	<!---HomePage element is empty--->
	<HomePage URL="http://www.marktwain.com"/>

As the diagram below shows, a complex-type element can be empty, contain simple content such as a string, or can contain complex content such as a sequence of elements.

Whereas it is not necessary to explicitly declare that a simple-type element is a simple type, it is necessary to specify that a complex-type element is a complex type. This is done with the xs:complexType element as shown below.


<xs:element name="ElementName">
		<!--Content Model Goes Here-->