Re: [Simple-support] How to get info within just one tag
Brought to you by:
niallg
|
From: Gareth M. <gar...@gm...> - 2012-02-22 16:13:59
|
Thank you very much that worked great!! :-)
On 23 February 2012 00:05, Adam Brown <ada...@gm...> wrote:
> You want to use the @Text annotation:
> @Element(name="youtube_feed")
> public class YoutubeFeed {
>
> @Text(required=true)
> public String youtube_feed;
> }
>
>
>
> On Wed, Feb 22, 2012 at 10:49 AM, Gareth Murfin <gar...@gm...>wrote:
>
>>
>> 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.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Virtualization & Cloud Management Using Capacity Planning
>> Cloud computing makes use of virtualization - but cloud computing
>> also focuses on allowing computing to be delivered as a service.
>> http://www.accelacomm.com/jaw/sfnl/114/51521223/
>> _______________________________________________
>> Simple-support mailing list
>> Sim...@li...
>> https://lists.sourceforge.net/lists/listinfo/simple-support
>>
>>
>
--
Gareth Murfin
Freelance Mobile Developer: J2ME, Blackberry, Android, WinPho 7
www.garethmurfin.co.uk
www.radiantsilverlabs.com/gaz
|