【问题标题】:ERROR] s4s-elt-schema-ns: The namespace of 'bindings' must be from the schema namespace, 'http://www.w3.org/2001/XMLSchema'错误] s4s-elt-schema-ns:“绑定”的命名空间必须来自模式命名空间,“http://www.w3.org/2001/XMLSchema”
【发布时间】:2012-04-13 01:12:42
【问题描述】:

编译我的 jaxb 文件时遇到以下错误。

C:\bea\jdk160_05\bin>xjc cmf.jaxb
parsing a schema...
[ERROR] s4s-elt-schema-ns: The namespace of element 'bindings' must be from the schema namespace, 'http://www.w3.org/2001/XMLSchema'.
  line 2 of file:/C:/bea/jdk160_05/bin/cmf.jaxb

JaxB 文件是

<?xml version='1.0'?>
<bindings xmlns="http://java.sun.com/xml/ns/jaxb" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"   xmlns:xs="http://www.w3.org/2001/XMLSchema"  version="2.1"> 
    <bindings schemaLocation="bi-cmf-flat_V1_0.xsd" >
        <!-- rename the value element -->
        <bindings node="//xs:complexType[@name='DeductibleType']">          
            <class name="DeductibleTypeAttribute"/>
        </bindings>
    </bindings>
</bindings>

【问题讨论】:

    标签: java jaxb xml-parsing


    【解决方案1】:

    XJC 调用的格式为:

    xjc -b <bindinfo> <schema>
    

    这意味着您的 XJC 调用应该是:

    xjc -b cmf.jaxb bi-cmf-flat_V1_0.xsd
    

    示例

    【讨论】:

      猜你喜欢
      • 2011-06-22
      • 2015-06-21
      • 2016-12-03
      • 1970-01-01
      • 2014-02-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-27
      相关资源
      最近更新 更多