Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse XML that has elements with the same name under different namespaces #30

Open
magneticflux- opened this issue Dec 16, 2017 · 1 comment

Comments

@magneticflux-
Copy link

When parsing RSS feeds, I run into an issue with the itunes namespace. I have a root with two elements: author and itunes:author, and I am unable to correctly parse them. I've tried specifying the namespace on the element itself and I've tried specifying the element path using @Path, but to no avail. Is functionality like this supported in SimpleXML?

@magneticflux-
Copy link
Author

Here is the error that occurs when I only add an element for the first author:

Caused by: org.simpleframework.xml.core.PersistenceException: Element 'author' is already used with @org.simpleframework.xml.Element(data=false, name=author, required=true, type=void) on field 'author' private final java.lang.String org.x.y.z.a.b.Item.author at line 1

Here is the error that occurs when I add both elements, with the itunes one having a namespace declaration:

Caused by: org.simpleframework.xml.core.ConstructorException: Parameter 'author' is a duplicate in public org.x.y.z.a.b.Item(java.lang.String,java.lang.String,java.lang.String,java.lang.String,org.x.y.z.a.b.Guid,java.lang.String,org.x.y.z.a.b.Source)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant