java通过xstream解析xml,这样的节点bean对象应该如何创建? 10
<price><priceWithoutTaxescurrency='CNY'>215</priceWithoutTaxes><priceWithTaxescurrenc...
<price>
<priceWithoutTaxes currency='CNY'>215</priceWithoutTaxes>
<priceWithTaxes currency='CNY'>215</priceWithTaxes>
<priceWithoutTaxesWritten>-</priceWithoutTaxesWritten>
<priceWithTaxesWritten>-</priceWithTaxesWritten>
</price>
@XStreamAlias("price")
public class Price {
private PriceWithoutTaxes priceWithoutTaxes;
private PriceWithTaxes priceWithTaxes;
private String priceWithoutTaxesWritten;
private String priceWithTaxesWritten;
//get和set方法
}
@XStreamAlias("priceWithoutTaxes")
public class PriceWithoutTaxes {
private String currency;
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
}
请问我应该如何获得到
<priceWithoutTaxes currency='CNY'>215</priceWithoutTaxes>这个节点中的
文本215? 展开
<priceWithoutTaxes currency='CNY'>215</priceWithoutTaxes>
<priceWithTaxes currency='CNY'>215</priceWithTaxes>
<priceWithoutTaxesWritten>-</priceWithoutTaxesWritten>
<priceWithTaxesWritten>-</priceWithTaxesWritten>
</price>
@XStreamAlias("price")
public class Price {
private PriceWithoutTaxes priceWithoutTaxes;
private PriceWithTaxes priceWithTaxes;
private String priceWithoutTaxesWritten;
private String priceWithTaxesWritten;
//get和set方法
}
@XStreamAlias("priceWithoutTaxes")
public class PriceWithoutTaxes {
private String currency;
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
}
请问我应该如何获得到
<priceWithoutTaxes currency='CNY'>215</priceWithoutTaxes>这个节点中的
文本215? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询