问题描述
我来了
"src-resolve: 无法将名称 'j2ee:descriptionType' 解析为 (n) '类型定义'组件."
我的 xsd 文件中出现此错误.
this error in my xsd file.
请帮我解决这个问题.
推荐答案
错误意味着 descriptionType 是您的 XSD 中引用的 XML Schema 类型(简单或复杂),类似于 type="j2ee:descriptionType"
.您的 XSD 需要引用(使用 import 或 include)包含此定义的 XSD 文件.
The error means that the descriptionType is an XML Schema type (simple or complex) that is being referenced in your XSD, something like type="j2ee:descriptionType"
. Your XSD needs to reference (using an import or include) the XSD file which contains this definition.
要找出可能是哪一个,您可以使用与 j2ee
映射的 URI,这将为您提供所需架构的目标命名空间.如果这与您的 XSD 不同,那么您需要使用类似 <xsd:import namespace="j2ee uris goes here" schemaLocation="where is it?"/>
; 之类的东西.否则,是 <xsd:include schemaLocation="where is it?"/>
To find out which might be, you use the URI mapped with j2ee
which will give you the target namespace of the schema you need. If that is different than of your XSD's, then you need to use something like <xsd:import namespace="j2ee uris goes here" schemaLocation="where is it?"/>
; otherwise, is an <xsd:include schemaLocation="where is it?"/>
如果您的 XSD 中已经有该导入/包含,那么架构位置就是您的问题;检查它是否解决了某些问题.这就是事情可能变得棘手的地方,因为这取决于你如何得到错误,而你什么也没说.
If you already have that import/include in your XSD, then the schema location is your problem; check that it resolves to something. This is where things might get tricky, since it depends on how you're getting the error, of which you said nothing.
如果是编辑器,那就看情况了;也许您需要配置一些目录来解析命名空间引用,也许您只需将文件复制到您的文件系统等.
If it's an editor, then it depends; maybe you need to configure some catalog that resolves namespace references, maybe you just copy the file over to your file system, etc.
这篇关于如何解决此错误:src-resolve:无法将名称“j2ee:descriptionType"解析为(n)“类型定义"组件.?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!