SimpleXML的:元素“链接”已被使用 [英] SimpleXML: Element 'link' is already used
问题描述
您好,我的英语不好对不起。
看看XML我试图解析:
Hello and sorry for my bad English. Look at the XML I'm trying to parse:
<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 code如下:
And SimpleXML code looks like:
public class Author_feed {
@Element
private String name;
@ElementList(inline = true)
@Namespace (prefix = "y")
private List<Link_feed> link;
}
Hovewer我看到一个错误:
Hovewer I see an error:
元素链接已被使用...... [和指向第二个链接行]
Element 'link' is already used...[and points to the second "link" line]
我该怎么办?
推荐答案
我发现这个链接<一个href=\"http://stackoverflow.com/questions/14474368/android-org-simpleframework-xml-persistence-exception-element-foo-is-already\">Android, org.simpleframework.xml持久性异常,元素'富'已被使用
请尝试使用 @ElementList(入门=链接,内联= TRUE)
这可能是有益的另一个引用是<一个href=\"http://simple.sourceforge.net/download/stream/doc/javadoc/org/simpleframework/xml/ElementList.html\"相对=nofollow>注释类型元素列表
Another reference that might be helpful is Annotation Type ElementList
这篇关于SimpleXML的:元素“链接”已被使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!