有没有用过xstream生成xml的朋友,帮忙看一下能不能解决,谢谢
就是转成下面这种xml格式的,有一个对应的weatherBean,包含firstDay中的所有结点名,但是三天的天气只有第一天是最详细的,第二天和第三天只有部分属性,这样...
就是转成下面这种xml格式的,有一个对应的weatherBean,包含firstDay中的所有结点名,但是三天的天气只有第一天是最详细的,第二天和第三天只有部分属性,这样改怎么写,需要修改bean吗,具体如何生成xml,拜谢了。:
<?xml version="1.0" encoding="utf-8"?>
<Place name="嘉兴">
<Firstday>
<UpdateTime>2014/12/07 09:15:29</UpdateTime>
<DateTime>12月8日</DateTime>
<WeatherName>多云转阴</WeatherName>
<Mintemperature>4°C</Mintemperature>
<Maxtemperature>10°C</Maxtemperature>
<WindState>北风 2级</WindState>
<HumidityState>湿度:47%</HumidityState>
<DressingDegree>较冷</DressingDegree>
<TravelingDegree>适宜</TravelingDegree>
<SportsDegree>较不宜</SportsDegree>
<ColdDegree>较宜发</ColdDegree>
<LightDegree>最弱</LightDegree>
<ComfortDegree>较舒适</ComfortDegree>
</Firstday>
<SecondDay>
<DateTime>12月8日</DateTime>
<WeatherName>多云转阴</WeatherName>
<Mintemperature>5°C</Mintemperature>
<Maxtemperature>10°C</Maxtemperature>
<WindState>北风 2级</WindState>
</SecondDay>
<ThirdDay>
<DateTime>12月9日</DateTime>
<WeatherName>多云转阴</WeatherName>
<Mintemperature>6°C</Mintemperature>
<Maxtemperature>10°C</Maxtemperature>
<WindState>北风 2级</WindState>
</ThirdDay>
</Place> 展开
<?xml version="1.0" encoding="utf-8"?>
<Place name="嘉兴">
<Firstday>
<UpdateTime>2014/12/07 09:15:29</UpdateTime>
<DateTime>12月8日</DateTime>
<WeatherName>多云转阴</WeatherName>
<Mintemperature>4°C</Mintemperature>
<Maxtemperature>10°C</Maxtemperature>
<WindState>北风 2级</WindState>
<HumidityState>湿度:47%</HumidityState>
<DressingDegree>较冷</DressingDegree>
<TravelingDegree>适宜</TravelingDegree>
<SportsDegree>较不宜</SportsDegree>
<ColdDegree>较宜发</ColdDegree>
<LightDegree>最弱</LightDegree>
<ComfortDegree>较舒适</ComfortDegree>
</Firstday>
<SecondDay>
<DateTime>12月8日</DateTime>
<WeatherName>多云转阴</WeatherName>
<Mintemperature>5°C</Mintemperature>
<Maxtemperature>10°C</Maxtemperature>
<WindState>北风 2级</WindState>
</SecondDay>
<ThirdDay>
<DateTime>12月9日</DateTime>
<WeatherName>多云转阴</WeatherName>
<Mintemperature>6°C</Mintemperature>
<Maxtemperature>10°C</Maxtemperature>
<WindState>北风 2级</WindState>
</ThirdDay>
</Place> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询