Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 具有多个XSD的JAXB_Xml_Jaxb_Xsd - Fatal编程技术网

Xml 具有多个XSD的JAXB

Xml 具有多个XSD的JAXB,xml,jaxb,xsd,Xml,Jaxb,Xsd,我正在尝试使用jaxb来处理xml 我使用xjc命令从xsd文件order.xsd生成java类 <?xml version="1.0"?> <!-- version 2.10 --> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:include schemaLocation="c.xsd"/> <xsd:element name="csa" type="para

我正在尝试使用jaxb来处理xml 我使用xjc命令从xsd文件order.xsd生成java类

<?xml version="1.0"?>
<!-- version 2.10 -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:include schemaLocation="c.xsd"/>
<xsd:element name="csa" type="param"/>
<xsd:complexType name="param">
    <xsd:all>
        <xsd:element name="User" type="alpha50" minOccurs="0"/>
        <xsd:element name="Infos" type="infosType"/>
        <xsd:element name="Params_Leg" type="params_LegType"/>
        <xsd:element name="Commande" type="commandeType"/>
    </xsd:all>
    <xsd:attribute name="version" type="xsd:decimal"/>
</xsd:complexType>
<!-- Atos / Command Parameters tree type -->
<xsd:complexType name="commandeType">
    <xsd:all>
        <xsd:element name="Mode" type="modeType"/>
        <xsd:element name="Etat" type="etatType"/>
                       <xsd:element name"IP" type="urlType">
    </xsd:all>
</xsd:complexType>
</xsd:schema>


我得到了许多带注释的类,但是@XmlRootElement(name=“Order”)和命名为Order的类都没有。对于每个复杂类型和具有匿名复杂类型的全局元素,将生成一个类。在XML模式中,根元素似乎是
csa
csa
元素有一个名为
param
的命名复杂类型,因此您需要创建
param
的实例。生成的
ObjectFactory
类将有一个方便的方法将其包装到
csa
元素中

了解更多信息


很棒的旅游,真的很有帮助