2013-08-02 28 views
1

你好,對不起我的英文不好。 看看XML我試圖解析:SimpleXML:Element'link'已被使用

<author> 
<name>Name</name> 
<y:link href="http://api-yaru.yandex.ru/person/20623655/" rel="self"/> 
<y:link href="http://upics.yandex.net/20623655/normal" rel="userpic"/> 
</author> 

和SimpleXML代碼如下所示:

public class Author_feed { 
@Element 
private String name; 

@ElementList(inline = true) 
@Namespace (prefix = "y") 
private List<Link_feed> link; 
} 

Hovewer我看到一個錯誤:

Element 'link' is already used...[and points to the second "link" line]

我該怎麼辦?

回答

3

我發現這個鏈接Android, org.simpleframework.xml Persistence Exception, Element 'foo' is already used

嘗試使用@ElementList(entry="link", inline=true)

可能有幫助的是Annotation Type ElementList

+0

謝謝另一個參考!但是我有另一個(類似的)問題。我可以以某種方式與你聯繫嗎?只是一個問題。 – Groosha

+1

試試這個聊天室.. http://chat.stackoverflow.com/rooms/33794/room-for-paolo-casciello-and-kneel-before-zod –