hahaenenene的gravatar头像
hahaenenene 2018-01-17 09:29:00

导入项目maven后xml,xsd文件为什么报错?

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.ken.com/schema/EJConvertor"
            elementFormDefault="qualified">

    <!-- 根标签 -->
    <xsd:element name="configuration">
        <xsd:complexType>
            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
                <xsd:element name="entity" type="entityType"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

    <!--entity标签-->
    <xsd:complexType name="entityType">
        <xsd:sequence  minOccurs="0" maxOccurs="unbounded">
            <xsd:choice>
                <xsd:element name="property" type="propertyType"/>
            </xsd:choice>
        </xsd:sequence>
        <xsd:attribute name="class" type="xsd:string" use="required"/>
        <xsd:attribute name="sheetName" type="xsd:string" use="optional"/>
        <xsd:attribute name="boldHeading" type="xsd:boolean" use="optional"/>
    </xsd:complexType>

    <!--property标签-->
    <xsd:complexType name="propertyType">
        <xsd:sequence maxOccurs="1">
            <xsd:element name="field" type="xsd:string"/>
            <xsd:element name="value" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>

</xsd:schema>

src-resolve.4.1: Error resolving component 'entityType'. It was detected that 'entityType' has no namespace, but components with no 
 target namespace are not referenceable from schema document 'file:///D:/eclipseworkspace/WMS/src/main/resources/config/
 EJConvertor.xsd'. If 'entityType' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that 
 'entityType' has no namespace, then an 'import' without a "namespace" attribute should be added to 'file:///D:/eclipseworkspace/
 WMS/src/main/resources/config/EJConvertor.xsd'.

Description Resource Path Location Type

Referenced file contains errors (file:/D:/eclipseworkspace/WMS/src/main/resources/config/EJConvertor.xsd).  For more information, right click on the message in the Problems View and select "Show Details..." EJConvertorConfig.xml /WMS/src/main/resources/config line 1 XML Problem

所有回答列表(3)
柒晓白的gravatar头像
柒晓白  LV10 2018年1月21日

引用文件包含错误(文件:/:/ eclipseworkspace /仓库/ src/main/resources /配置/ ejconvertor .xsd)。这是你maven仓库的问题吧。

“EntityType '没有命名空间,然后“导入”没有“命名空间”属性应该被添加到“文件:/ / / D / eclipseworkspace /

331596801的gravatar头像
331596801 2018年6月12日

最后怎么解决的?

 

Michelle1106的gravatar头像
Michelle1106  LV5 2018年7月11日

请问这个问题解决了么

顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友