xstream怎么设置xmlns:xsi
生成xml报文,但是需要设置xmlns:xsi , xsi:schemaLocation ,xsi:type这三个属性,怎么设置?
回答:
@XStreamAlias("root")class RootElement
{
@XStreamAsAttribute
final String xmlns = "http://www.example.org"
@XStreamAsAttribute
@XStreamAlias("xmlns:xlink")
final String xlink="http://www.w3.org/1999/xlink"
SomeElement someElement
}
class SomeElement
{
@XStreamAsAttribute
@XStreamAlias("xml:id")
String id
@XStreamAsAttribute
@XStreamAlias("xlink:href")
String href
}
https://stackoverflow.com/a/8...
以上是 xstream怎么设置xmlns:xsi 的全部内容, 来源链接: utcz.com/p/944493.html