I am defining the schema but on validating it in eclipse it gives following error.
src-resolve: Cannot resolve the name \'common:Name\' to a(n) \'type def
From what you show it looks like you have an element Name
in the common
namespace, but not the type and you're trying to use the type here:
<xsd:element name="Name" type="common:Name" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Name</xsd:documentation>
</xsd:annotation>
</xsd:element>
So either create a type common:Name
or use <xsd:element ref="common:Name" .../>
instead.
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.bharatsecurity.com/Patients"
xmlns:tns="http://www.bharatsecurity.com/Patients"
elementFormDefault="qualified">
<element name="patient" type="tns:Patients"></element>
you need to write complex type for this tns otherwise it will result in cannot resolve type (n) error like :-
<complexType name="Patients">
<sequence>
<element name="id" type="int" />
<element name="name" type="string"></element>
<element name="gender" type="string"></element>
<element name="age" type="int"></element>
</sequence>
</complexType>
</schema>