eclipse - cvc-complex-type.3.2.2 : Attribute 'jaxb:extensionBindingPrefixes' is not allowed to appear in element 'jaxb:bindings'

标签 eclipse maven jaxb xjc

我已经检查了一个项目......并尝试解决 Eclipse Luna 4.4.0 中的一些问题。在一个 Maven 项目中,我有以下 xjb 文件:

<?xml version="1.0" encoding="UTF-8"?>
    <jaxb:bindings
    version="2.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    jaxb:extensionBindingPrefixes="xjc"
    xmlns:xjc= "http://java.sun.com/xml/ns/jaxb/xjc"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xsi:schemaLocation="
    http://java.sun.com/xml/ns/jaxb
    http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd
">
...
...

但 Eclipse 报告我的问题 >
cvc-complex-type.3.2.2: 属性 'jaxb:extensionBindingPrefixes' 不允许出现在元素 'jaxb:bindings'

有人知道为什么吗?

最佳答案

bindingschema_2_0.xsd似乎是不够的。它声明了 extensionBindingPrefixes属性,但不在全局 bindings 中使用它元素。

使用jaxb:extensionBindingPrefixes您发布的代码中的属性对我来说看起来是正确的。

我个人,我从未使用过 xsi:location在绑定(bind)文件中。您可以安全地删除它。

关于eclipse - cvc-complex-type.3.2.2 : Attribute 'jaxb:extensionBindingPrefixes' is not allowed to appear in element 'jaxb:bindings' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26832324/

相关文章:

android - 更改android项目的名称

maven - 运行 atlas-cli pi 命令时出现 "MojoExecutionException: Unable to execute mojo"

java - 向 JAXB 生成的类添加行为

android - 为什么找不到Widget.TabPageIndicator?

java - Eclipse 跳转到 Ctrl-S 上的函数名称

java - Spring应用程序404适用于css文件,但不适用于html文件

java - CheckStyle 检查未被忽略

java - '&quot ;' instead of normal quotes ("") 从 Jersey 返回 XML

java - XML SOAP 信封在 JAXB 中变为空

java - 在部署 tomcat 时挂起并给出异常