XSD: Cannot resolve the name 'type' to a(n) 'type definition' component

强颜欢笑 提交于 2019-12-04 01:43:45

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!