简体   繁体   English

cvc-elt.1:找不到元素“更改集”的声明

[英]cvc-elt.1: Cannot find the declaration of element 'change-set'

I'm trying to use some open-source software for RFID services (GitHub: fosstrak capturing application ) from a few years ago and there's this error that I can't fix.几年前,我正在尝试使用一些用于 RFID 服务的开源软件(GitHub: fosstrak 捕获应用程序),但有一个我无法修复的错误。

(null: 3, 230): cvc-elt.1: Cannot find the declaration of element 'change-set'.

I'm using Docker to containerise the application running Tomcat7 with Java8.我正在使用 Docker 将运行 Tomcat7 的应用程序与 Java8 容器化。

The XML looks like this: XML 看起来像这样:

<?xml version="1.0" encoding="utf-8" ?>
<change-set xmlns="http://drools.org/drools-5.0/change-set" 
  xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="http://drools.org/drools-5.0/change-set.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd">
  <add>
    <resource source="classpath:drools/SimpleEPCISDocument.drl" type="DRL" />
  </add>
</change-set>

And the XSD: XSD:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
            elementFormDefault="qualified" 
            targetNamespace="http://drools.org/drools-5.0/change-set" 
            xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
            xmlns:change-set="http://drools.org/drools-5.0/change-set">
  <xsd:import namespace="http://www.w3.org/2001/XMLSchema-instance"/>
  <xsd:element name="change-set">
    <xsd:complexType>
      <xsd:choice>
        <xsd:element ref="change-set:add"/>
        <xsd:element ref="change-set:remove"/>
      </xsd:choice>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="add">
    <xsd:complexType mixed="true">
      <xsd:sequence>
        <xsd:element minOccurs="0" maxOccurs="unbounded" ref="change-set:resource"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="remove">
    <xsd:complexType mixed="true">
      <xsd:sequence>
        <xsd:element minOccurs="0" maxOccurs="unbounded" ref="change-set:resource"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="resource">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:any minOccurs="0"/>
        <xsd:element minOccurs="0" ref="change-set:decisiontable-conf"/>
      </xsd:sequence>
      <!-- URL to the resource, can be file based -->
      <xsd:attribute name="source" use="required" type="xsd:anyURI"/>
      <!-- for example, DRL, or PKG -->
      <xsd:attribute name="type" use="required" type="xsd:string"/>
      <xsd:attribute name="basicAuthentication" type="xsd:string"/>
      <xsd:attribute name="username" type="xsd:string"/>
      <xsd:attribute name="password" type="xsd:string"/>
    </xsd:complexType>

  </xsd:element>
  <xsd:element name="decisiontable-conf">
    <xsd:complexType>
      <xsd:attribute name="input-type" use="required" type="xsd:NCName"/>
      <xsd:attribute name="worksheet-name" use="required" type="xsd:NCName"/>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

Change改变

xs:schemaLocation="http://drools.org/drools-5.0/change-set.xsd [...]

to

xs:schemaLocation="http://drools.org/drools-5.0/change-set [...]

because schemaLocation must be a series of pairs of namespace URIs and XSD locations.因为schemaLocation必须是一系列命名空间 URI 和 XSD 位置对。 In this case, the namespace URI is http://drools.org/drools-5.0/change-set , which matches the namespace of the root element in your XML and the target namespace of your XSD.在这种情况下,命名空间 URI 是http://drools.org/drools-5.0/change-set ,它与 XML 中的根元素的命名空间和 Z0CD3581B75ED022EDZCFZ.650CFB61 的目标命名空间相匹配

See also也可以看看

You'll also have to deal with a subsequent Unique Particle Attribute issue, but that's a separate matter deserving its own question if you're unable to resolve.您还必须处理后续的唯一粒子属性问题,但如果您无法解决,那将是一个单独的问题,值得自己提出问题。 Start with XSD validation - ANY in SEQUENCE ("Unique Particle Attribution") .XSD 验证开始 - ANY in SEQUENCE ("Unique Particle Attribution")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM