[Simple-support] How to get info within just one tag
Brought to you by:
niallg
|
From: Gareth M. <gar...@gm...> - 2012-02-22 15:49:23
|
Hi, Awesome tool, its working well apart from one issue, in my xml I have <youtube_feed> http://gdata.youtube.com/feeds/api/playlists/CD1BZX438AFEAF2CCE68 </youtube_feed> How do I get at this? If I make my class like this import org.simpleframework.xml.Element; @Element(name="youtube_feed") public class YoutubeFeed { @Element(required=true) public String youtube_feed; } It complains of Error Occured Unable to satisfy @org.simpleframework.xml.Element(data=false, name=, required=true, type=void) on field 'youtube_feed' I can successfully get ones with more than one attribute within their own tags, for example: <rider_profiles> <rider_profiles_feed> http://www.blah.net </rider_profiles_feed> <rider_profiles_web> http://www.blah.net </rider_profiles_web> <rider_profile_pdf> http://www.blah.net </rider_profile_pdf> </rider_profiles> This works fine with my corresponding class: import org.simpleframework.xml.Element; @Element(name="rider_profiles") public class RiderProfiles { @Element(required=true) public String rider_profiles_feed; @Element(required=true) public String rider_profiles_web; @Element(required=true) public String rider_profile_pdf; } Any ideas? This looks like a real time saving lib and so I really love it so far :-) Gaz. |