How do I use the value of an XML element when setting the path in the Java SimpleXML library?

前端 未结 3 1757
傲寒
傲寒 2021-01-21 10:25

I have the following XML:


  
version 15.0 &
3条回答
  •  情歌与酒
    2021-01-21 11:14

    this is how it would look in xpath: /rdr/details/detail[name='version']/value/text()

    so maybe try:

    @Path("details/detail[name='version']")
    @Element(name = "value")
    private String resolution;
    

    see the '' it needs to know this is text

提交回复
热议问题