XStream 数组(List)输出结构

<!-- 期望的DOM树 -->
  <Articles>
    <item>
      <Title>微信SDK初步结构</Title>
      <Description>恩..这是微信project的结构,嘻嘻~</Description>
      <PicUrl>http://b.hiphotos.baidu.com/image/pic/item/d1a20cf431adcbeff71cbb18aeaf2edda3cc9f80.jpg</PicUrl>
    </item>
  </Articles>


原以为应该:

根对象中有个Articles类中,Articles类中包括一个变量名为 item的数组(list)对象才干够这样,结果:

<!-- 错误的DOM树 -->
  <Articles>
    <item>
<pre name="code" class="html">      <包名.item>
<Title>微信SDK初步结构</Title> <Description>恩..这是微信project的结构,嘻嘻~</Description> <PicUrl>http://b.hiphotos.baidu.com/image/pic/item/d1a20cf431adcbeff71cbb18aeaf2edda3cc9f80.jpg</PicUrl>
<pre name="code" class="html">      </包名.item>
    <item>
  </Articles>


研究了一下发现结构应该是这样:

根对象中直接有一个数组(List)的变量名为item就能够了...省去了我一个类,好开心~

posted @ 2017-07-19 21:55  cxchanpin  阅读(1804)  评论(0编辑  收藏  举报