首页javajaxbJava HTML/XML - 如何通过Jaxb读/写多级xml文件

Java HTML/XML - 如何通过Jaxb读/写多级xml文件

我们想知道如何通过Jaxb读/写多级xml文件。
<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.serus.com" xmlns:ns1="http://www.serus.com">
      <xs:element name="part">
        <xs:complexType> 
          <xs:sequence minOccurs="1" maxOccurs="1">
            <xs:element ref="ns1:Product_Number"/>
            <xs:element ref="ns1:Product_Type"/>
            <xs:element ref="ns1:Product_Version"/>
            <xs:element ref="ns1:Status"/>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element ref="ns1:part"/>
            </xs:choice>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="Product_Number" type="xs:NCName"/>
      <xs:element name="Product_Type" type="xs:NCName"/>
      <xs:element name="Product_Version" type="xs:NCName"/>
      <xs:element name="Status" type="xs:NCName"/>
    </xs:schema>