2010-08-17 64 views
6

当JAXB生成它时,它将创建OtherProperties作为List。我如何配置XSD,使其生成为Map?JAXB将从XSD创建一张地图

  <xsd:element name="OtherProperties" minOccurs="0"> 
      <xsd:complexType> 
       <xsd:sequence minOccurs="0" maxOccurs="unbounded"> 
        <xsd:element name="Property"> 
         <xsd:complexType> 
          <xsd:attribute name="name" type="xsd:string" /> 
          <xsd:attribute name="value" type="xsd:string" /> 
         </xsd:complexType> 
        </xsd:element> 
       </xsd:sequence> 
      </xsd:complexType> 
     </xsd:element> 

回答