JAXB ignoring xml tag attribute

前端 未结 1 1892
长情又很酷
长情又很酷 2021-01-21 22:03

I read xml files with JAXB. I have the following structure


  

I have the following model<

相关标签:
1条回答
  • 2021-01-21 22:44

    You should just have the following without the @XmlElement annotation:

    @XmlRootElement
    class A{
      @XmlPath("B/@value")
      String b;
    }
    
    0 讨论(0)
提交回复
热议问题