java - 简单的 : Element 'link' is already used

标签 java android xml deserialization simple-framework

你好,抱歉我的英语不好。 查看我正在尝试解析的 XML:

<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;
}

但是我看到一个错误:

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

我该怎么办?

最佳答案

我找到了这个链接 Android, org.simpleframework.xml Persistence Exception, Element 'foo' is already used

尝试使用 @ElementList(entry="link", inline=true)

另一个可能有用的引用是 Annotation Type ElementList

关于java - 简单的 : Element 'link' is already used,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18023830/

相关文章:

java.util.IllegalFormatConversionException : f ! = java.lang.String 错误

java 强制转换并调用字符串作为对象的方法

java - 替换/覆盖 android-sdk 的类

java - 除两个微调器值

javascript - MongoDB中如何存储XML格式的数据?

Android InputMethodEditor 布局文件。 XML 中的非键/行元素?

java - 使用 REST API 将图像文件上传到 Google Drive 时出错

java - 我应该使用 'synchronized' 版本作为 'onMessage' 中的集合消息吗?

java - 为什么++不给整数值加一

xml - 如何使用 XML API 获取 Jenkins 作业列表