Groosha
Groosha

Reputation: 3067

SimpleXML: Element 'link' is already used

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?

Upvotes: 1

Views: 1276

Answers (1)

Kinaan Khan Sherwani
Kinaan Khan Sherwani

Reputation: 1534

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

Upvotes: 3

Related Questions