我尝试通过Netbeans从xsd生成JAXB类,但是我得到了
C:\datos\NetBeansProjects\RegistradoresWSSERCON\nbproject\xml_binding_build.xml:15: grammar is not specified
相对于码道:
<xjc destdir="build/generated/jaxbCache/ACK" catalog="catalog.xml">
这是IM尝试使用的xsd:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wmh="http://www.wmhelp.com/2003/eGenerator" elementFormDefault="qualified">
<xs:element name="registroResponse">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="codigosError" nillable="true" type="tns:registroError"/>
<xs:element minOccurs="0" name="idTramite" type="xs:string"/>
<xs:element minOccurs="0" name="xml" type="xs:base64Binary"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="registroError">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="codigo" type="xs:string"/>
<xs:element minOccurs="0" name="descripcion" type="xs:string"/>
<xs:element minOccurs="0" name="detalles" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
有人知道发生了什么事吗?
编辑:xml_绑定_构建. xml
<?xml version="1.0" encoding="UTF-8"?><!--
*** GENERATED FROM xml_binding_cfg.xml - DO NOT EDIT ***
*** Configure thru JAXB Wizard. ***
--><project name="RegistradoresWSSERCON_jaxb" default="default" basedir=".">
<target name="xjc-typedef-target" depends="-init-project">
<typedef classname="com.sun.tools.xjc.XJCTask" name="xjc" xmlns:s="http://xml.netbeans.org/schema/JAXBWizConfig">
<classpath path="${jaxbwiz.xjcdef.classpath}"/>
</typedef>
</target>
<target name="jaxb-clean-code-generation" depends="clean,jaxb-code-generation"/>
<target name="jaxb-code-generation" depends="xjc-typedef-target,-do-init,-init-macrodef-javac">
<mkdir dir="${build.generated.sources.dir}/jaxb" xmlns:s="http://xml.netbeans.org/schema/JAXBWizConfig"/>
<mkdir dir="build/generated/jaxbCache" xmlns:s="http://xml.netbeans.org/schema/JAXBWizConfig"/>
<mkdir dir="build/generated/jaxbCache/ACK"/>
<xjc destdir="build/generated/jaxbCache/ACK" catalog="catalog.xml">
<classpath>
<pathelement location="${src.dir}"/>
<pathelement path="${jaxbwiz.xjcrun.classpath}"/>
</classpath>
<arg value="-xmlschema"/>
<schema file=""/>
<depends file=""/>
<produces dir="build/generated/jaxbCache/ACK"/>
</xjc>
<copy todir="${build.generated.sources.dir}/jaxb">
<fileset dir="build/generated/jaxbCache/ACK"/>
</copy>
<!--*** Web project javac macro does not support sourcepath attribute, so do not pass "sourcepath=${src.dir}"-->
</target>
2条答案
按热度按时间mpgws1up1#
<schema file=""/>
提供了一个空路径,jaxb没有要处理内容。xjc任务文档here。
Netbeans JAXB向导常见问题解答位于此处。
This article shows a dialog box of the wizard with a path and a browse button.
dldeef672#
确保提供xmlschema参数: