我有一个简单的绑定:
<binding>
<mapping name="entry" class="google.vo.GoogleContactsEntry" ordered="false">
<value name="title" field="title" usage="optional" />
<value name="email" field="email" usage="optional" />
</mapping>
<mapping name="feed" class="google.vo.GoogleContacts" ordered="false" flexible="true">
<namespace uri="http://www.w3.org/2005/Atom" default="elements"/>
<value name="id" field="id" usage="optional" />
<value name="updated" field="updatedString" usage="optional" />
<value name="title" field="title" usage="optional" />
<collection item-type="google.vo.GoogleContactsEntry" name="entries" field="entries"/>
</mapping>
</binding>
问题出在 Collection 元素中,它需要 name="entries"。Google 返回的条目没有包装元素。像这样:
<feed>
<entry>
</entry>
<entry>
</entry>
</feed>
JiBX 期望:
<feed>
<entries>
<entry>
</entry>
<entry>
</entry>
<entries>
</feed>
如果集合时绑定方案中没有元素名称,JiBX 将无法编译。有解决办法吗?