XStream : node with attributes and text node?

后端 未结 4 793
难免孤独
难免孤独 2020-12-09 03:59

I would like to serialize an object to an XML of this form with XStream.

text

The value of the node

4条回答
  •  情歌与酒
    2020-12-09 04:34

    This is much easier in JAXB

    @XmlRootElement
    public class Node {
    
        @XmlAttribute
        String att;
    
        @XmlValue
        String value;    
    
    }
    

提交回复
热议问题