How to deal with JAXB ComplexType with MixedContent data?

前端 未结 2 1049
说谎
说谎 2020-12-01 16:59

I got this XML structure:


  0.00
  
     17.5% No         


        
2条回答
  •  感动是毒
    2020-12-01 17:52

    With mixed=true, in ObjectFactory there should be a function like JAXBElement createTaxDescriptionTypeShortNameType(ShortNameType), which generates the serializable element for you.

     @XmlElementDecl(namespace = "", name = "shortnametype", scope = TaxDescriptionType.class)
        public JAXBElement createTaxDescriptionTypeShortNameType(ShortNameType value) {
            return new JAXBElement(new QName("", "shortnametype"), ShortNameType.class, TaxDescriptionType.class, value);
     }
    

提交回复
热议问题