Java 错误]s4s elt架构ns:的命名空间';绑定';必须来自架构命名空间&x27;http://www.w3.org/2001/XMLSchema'
编译jaxb文件时,我面临以下错误Java 错误]s4s elt架构ns:的命名空间';绑定';必须来自架构命名空间&x27;http://www.w3.org/2001/XMLSchema',java,jaxb,xml-parsing,Java,Jaxb,Xml Parsing,编译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/cm
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>
XJC调用的格式为:
xjc -b <bindinfo> <schema>
示例
xjc -b cmf.jaxb bi-cmf-flat_V1_0.xsd