本来想写一篇在Android下使用XStream解析XML文件的文章,后来发现http://yunzhongxia.javaeye.com/blog/539827 已经写的很好了,所以就不写了。把地址记录下来。

使用XStream时注意到官方文档的一句话:

XStream fails to unmarshal my given XML and I do not know why?

By default XStream is written for persistence i.e. it will read the XML it can write. If you have to transform a given XML into an object graph, you should go the other way round. Use XStream to transfer your objects into XML. If the written XML matches your schema, XStream is also able to read it. This way is much easier, since you can spot the differences in the XML much more easy than to interpret the exceptions XStream will throw if it cannot match the XML into your objects.

本文出自 “最牛傻蛋的博客” 博客,转载请与作者联系!

更多相关文章

  1. Android(安卓)UI学习 - ListView
  2. Android(安卓)开发最佳实践
  3. Android使用MQTT协议
  4. Android(安卓)--spinner构造下垃菜单
  5. android动画之android:interpolator属性使用
  6. [Android入门]体系结构、UI组件使用、获得帮助、分析TinyPlayer
  7. 箭头函数的基础使用
  8. NPM 和webpack 的基础使用
  9. Python list sort方法的具体使用

随机推荐

  1. android流式布局热门标签的实现
  2. android:cacheColorHint,android:listSel
  3. shape .xml
  4. 安装Intel HAXM为Android 模拟器加速,30秒
  5. google Android 认证测试
  6. 2、创建android应用程序
  7. Ubuntu下连接Android设备
  8. android PhoneGap 的入门例子
  9. android 最全的shape属性
  10. Android(安卓)之 Context Menu 上下文菜