问题
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>
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 I see an error:
Element 'link' is already used...[and points to the second "link" line]
What shall I do?
回答1:
I have found this link Android, org.simpleframework.xml Persistence Exception, Element 'foo' is already used
try using @ElementList(entry="link", inline=true)
Another reference that might be helpful is Annotation Type ElementList
来源:https://stackoverflow.com/questions/18023830/simplexml-element-link-is-already-used