When I try to validate the below XML against the below XSD I get the following error:
cvc-complex-type.2.4.a: Invalid content was found starting with element >'personal'. One of '{personal} expected.
XML
<main xmlns = "http://www.example.com"
xmlns:xsi = "https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation = "main.xsd">
<personal>
<full-name>John Smith</full-name>
<contact>
<street-address>12345 Example Street</street-address>
<city>Somewhere</city>
<state>EX</state>
<postal-code>111 111</postal-code>
<phone>123 456 7890</phone>
<email>myemail@example.com</email>
</contact>
</personal>
</main>
XSD
<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema"
targetNamespace = "http://www.example.com"
xmlns = "http://www.example.com">
<xsd:element name = "main" type = "main-type"/>
<xsd:complexType name = "main-type">
<xsd:all>
<xsd:element name = "personal" type = "personal-type"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name = "personal-type">
<xsd:all>
<xsd:element name = "full-name" type = "xsd:string"
minOccurs = "1"/>
<xsd:element name = "contact" type = "contact-type"
minOccurs = "1"/>
</xsd:all>
</xsd:complexType>
<!--Different xsd:strings for contact information in contact-type-->
<xsd:complexType name = "contact-type">
<xsd:all>
<xsd:element name = "street-address" type = "xsd:string"/>
<xsd:element name = "city" type = "xsd:string"/>
<xsd:element name = "state" type = "xsd:string"/>
<xsd:element name = "postal-code" type = "xsd:string"/>
<xsd:element name = "phone" type = "xsd:string"/>
<xsd:element name = "email" type = "xsd:string"/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
What's the problem and how can I fix it?