Re: [Simple-support] Duplicate element error
Brought to you by:
niallg
|
From: Dody G. <emp...@gm...> - 2012-12-30 13:45:41
|
Unfortunately I cannot figure out how to deal with InputNode so I have to
resort to @Path
@Element(required = false, name = "link")
@Path("channel/link")
public String link;
which works.
The problem though with this solution is that RSS/ATOM feeds are full of
extensions via namespaces and right now the current behavior of @Element
simply makes parsing Rss/Atom feed with SimpleXML problematic. Any RSS/ATOM
extension that duplicates on the default namespace single element will
break the parsing.
On Wed, Dec 26, 2012 at 11:39 AM, Niall Gallagher <gal...@ya...
> wrote:
> There is a way, however it involves the lower level stream XML API. You
> would need to wrap the InputNode with something of your own to filter out
> these things. See org.simpleframework.xml.stream.InputNode.
>
> --- On Mon, 24/12/12, Dody Gunawinata <emp...@gm...> wrote:
>
> > From: Dody Gunawinata <emp...@gm...>
> > Subject: [Simple-support] Duplicate element error
> > To: sim...@li...
> > Received: Monday, 24 December, 2012, 6:33 AM
> > I encounter the same exact
> > problem as this posting
> http://stackoverflow.com/questions/5973028/simple-xml-element-declared-twice-error
> >
> >
> > public class Channel {
> > @Element(required = false, name =
> > "link") @Namespace
> > public String link; }
> >
> > will generate
> > Element 'link' is already used
> > with @org.simpleframework.xml.Element(data=false, name=link,
> > required=false, type=void) on field 'link'
> >
> >
> > if it encounters
> > <link> and<atom:link>.
> > I don't care about the atom:link. Is
> > there anyway to scope the link property to just care about
> > the default namespace?
> >
> >
> > --
> > nomadlife.org
> >
> >
> >
> > -----Inline Attachment Follows-----
> >
> >
> ------------------------------------------------------------------------------
> > LogMeIn Rescue: Anywhere, Anytime Remote support for IT.
> > Free Trial
> > Remotely access PCs and mobile devices and provide instant
> > support
> > Improve your efficiency, and focus on delivering more
> > value-add services
> > Discover what IT Professionals Know. Rescue delivers
> > http://p.sf.net/sfu/logmein_12329d2d
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > Simple-support mailing list
> > Sim...@li...
> > https://lists.sourceforge.net/lists/listinfo/simple-support
> >
>
--
nomadlife.org
|