使用XStream javabean转xml的时候,碰上一个没转换过的形式:
<标签 键=值>值</标签>,这种形式的xml应该怎么生成
例子: 1/stag:PrimaryQuantity
因我的项目不能公开,不能给你源码,在java中想要与xml交互,最好的方式就是用cfx框架,可自行百度做做实验,如果卡到问题了,可以问我,我常在CSDN,求给点分!
Address.java
Person.java
TestStream.java
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
- 〈一句话功能简述〉
- 〈功能详细描述〉
- @author Administrator / @XStreamAlias("address") public class Address { private String street; private int houseNo; /*
- @return the street / public String getStreet() { return street; } /*
- @param street the street to set / public void setStreet(String street) { this.street = street; } /*
- @return the houseNo / public int getHouseNo() { return houseNo; } /*
- @param houseNo the houseNo to set */ public void setHouseNo(int houseNo) { this.houseNo = houseNo; }
}




自己去看吧