TO COMPILE Schema
1. Create JAXB binding file as follows
<jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="file:///@XSD_ROOT_DIR@/../xxxxxx.xsd" node="/xs:schema">
<jxb:globalBindings>
<jxb:javaType name="java.util.Calendar" xmlType="xs:date"
parseMethod="javax.xml.bind.DatatypeConverter.parseDate"
printMethod="javax.xml.bind.DatatypeConverter.printDate"
/>
</jxb:globalBindings>
</jxb:bindings>
<jxb:bindings schemaLocation="file:///@XSD_ROOT_DIR@/xxxxxx.xsd" node="/xs:schema">
<jxb:schemaBindings>
<jxb:package name="au.xx..x..xx.x.x.x.x.x.v1"/>
</jxb:schemaBindings>
</jxb:bindings>
<jxb:bindings schemaLocation="file:///@XSD_ROOT_DIR@/xxxxxxxxxxxxxx.xsd" node="//xs:complexType[@name='XXXXXXXXXXXXXXXType']">
<jxb:class name="XXXXXXXXXXXXXXXXXXXXXXXXXType"/>
</jxb:bindings>
<jxb:bindings schemaLocation="file:///@XSD_ROOT_DIR@/xxxxxxxxxxxxxxxxxxxxx.xsd" node="//xs:complexType[@name="xxxxxxxxxxxxxxxxType']">
<jxb:class name="xxxxxxxxxxxTypeComplex"/>
</jxb:bindings>
<jxb:bindings schemaLocation="file:///@XSD_ROOT_DIR@/xxxxxxxxxxxxxxxxxxxxxxx.xsd" node="/xs:schema">
<jxb:schemaBindings>
<jxb:package name="x.x.x.x..x.x.x.x.x.x.x.x.jaxb.v1"/>
</jxb:schemaBindings>
</jxb:bindings>
</jxb:bindings>
2. add xjc task in build.xml
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpathref="jaxb.class.path">
<!--classpath>
<fileset dir="${xxx_folder}/Jaxb2.0.5" includes="*.jar" />
</classpath-->
</taskdef>
-------------------
<target name="compile-xxxx">
<!-- create source dir -->
<mkdir dir="${sv259.src}" />
<!-- compile response schema -->
<xjc schema="${xsd.root.dir}/xxx/xxx/xx/x/x/xx/x/xxx.xsd"
target="${output.folder.src}" >
<binding dir="${jaxb.binding.dir}/folder" includes="binding-response.xjb"/>
</xjc>
......
</target
分享到:
相关推荐
J2EE中解析XML文件的技术。最初JAXB是JavaEE的一部分,在JDK6.0中,sun将其移到了JavaSE中。在JDK6.0中,JAXB的版本中2.0,比起1.0版本,JAXB2.0基于Annotation来标识要作绑定的类和属性,从而缩减了开发工作量。
THE Java™Architecture for XML Binding (JAXB) provides a fast and convenient way to bind between XML schemas and Java representations, making it easy for Java developers to incorporate XML data and ...
NULL 博文链接:https://rayoo.iteye.com/blog/1233534
在android 6.0下,应用JAXB jar包根据XML Schema解析XML文件。
JAXB的使用JAXB的使用JAXB的使用JAXB的使用
On Windows, you can just double-click the jar file to execute. Release Notes Browse the release notes online, including what's new. Technical Support Please subscribe to the users list and send ...
编写xsd文件,利用jaxb生成java类。
无需安装,解压后即可。jaxb-api.jar,jaxb-xjc.jar,jaxb-impl.jar,activation.jar等相关jar包在lib文件夹下。
jaxb-api jaxb-impl jar
JAXB的安装包及插件
在使用webservice,mule esb等需要jaxb的项目里经常会出现 JAXB 2.0 API is being loaded from the bootstrap classloader这个错误,按照打出的信息Use the endorsed directory mechanism to place jaxb-api.jar in ...
JAXB的 eclipse插件 JAXB的 eclipse插件 JAXB的 eclipse插件 JAXB的 eclipse插件 JAXB的 eclipse插件
Jaxb annotation 使用 Jaxb annotation初步使用
在使用webservice,esb等需要jaxb的项目里经常会出现 JAXB 2.0 API is being loaded from the bootstrap classloader错误.执行System.out.println(System.getProperty("java.endorsed.dirs"));输出jaxb-api-2.1.jar...
activation.jar jaxb1-impl.jar jaxb-api.jar jaxb-impl.jar jaxb-xjc.jar jsr173_1.0_api.jar系列jar下载
JAXB注解相关技术JAXB注解相关技术JAXB注解相关技术JAXB注解相关技术JAXB注解相关技术JAXB注解相关技术
1. 什么是JAXB? Java Architecture for XML Binding (JAXB) 是一个业界的标准,是一项可以根据XML
使用jaxb生成XML例子,含有例子和注解解析
有关Maven项目中缺少jaxb-api的异常报错解决,jaxb-api-2.3.0.jar
jaxb-api jaxb-impl jaxb-xjc jaxws-rt 这四个文件对应的jar包