This is my sample XML Code:
<bestContact>
<firstName><![CDATA[12345]]></firstName>
<lastName />
</bestContact>
I am using:
<xs:element name="lastName" type="xs:string" minOccurs="1" nillable="false"/>
The XSD Should be validate lastName
as not null or empty.
Try
<xs:element name="lastName" minOccurs="1" nillable="false">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>