hi all,
i posted something on smartgwt forum but didn't get much response.
so i hope someone here can give me some advices.
..............................................................................................................................................................
I can't retrieve the value of the nested xml element. i want to
retrieve the value of "name" under the "author" node
below is my datasource.
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.fields.DataSourceFloatField;
import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceLinkField;
import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.data.fields.DataSourceImageField;
import com.smartgwt.client.types.DSDataFormat;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
public class Twitter2XmlDS extends DataSource{
private static Twitter2XmlDS instance = null;
public static Twitter2XmlDS getInstance() {
if (instance == null) {
instance = new Twitter2XmlDS("twitterDS");
}
return instance;
}
public Twitter2XmlDS(String id) {
setID(id);
setDataFormat(DSDataFormat.XML);
setRecordXPath("//default:entry");
setDataURL("ds/test_data/twitter2.data.xml");
System.out.println(getRecordXPath());
System.out.println(getDataFormat().toString());
DataSourceTextField title_Field = new DataSourceTextField
("title", "Title");
DataSourceTextField updated_Field = new DataSourceTextField
("updated", "Updated");
***DataSourceTextField author_Field = new DataSourceTextField
("name","Author_name");***
***author_Field.setValueXPath("author/name");***
setFields(title_Field,updated_Field,author_Field);
setClientOnly(true);
}
}
my atom xml:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns:google="http://base.google.com/ns/1.0" xml:lang="en-US"
xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://
www.w3.org/2005/Atom" xmlns:twitter="http://api.twitter.com/">
<id>tag:search.twitter.com,2005:search/twitter</id>
<link type="text/html" rel="alternate" href="http://
search.twitter.com/search?q=twitter"/>
<link type="application/atom+xml" rel="self" href="http://
search.twitter.com/search.atom?q=twitter"/>
<title>twitter - Twitter Search</title>
<link type="application/opensearchdescription+xml" rel="search"
href="http://search.twitter.com/opensearch.xml"/>
<link type="application/atom+xml" rel="refresh" href="http://
search.twitter.com/search.atom?q=twitter&since_id=1274320152"/>
<updated>2009-03-03T16:19:18Z</updated>
<openSearch:itemsPerPage>15</openSearch:itemsPerPage>
<link type="application/atom+xml" rel="next" href="http://
search.twitter.com/search.atom?
max_id=1274320152&page=2&q=twitter"/>
<entry>
<id>tag:search.twitter.com,2005:1274320152</id>
<published>2009-03-03T16:19:18Z</published>
<link type="text/html" rel="alternate" href="http://twitter.com/
kaplanmyrth/statuses/1274320152"/>
<title>Watching @ev at #TED talking about #Twitter:
http://ping.fm/IS0GK</title>
<content type="html">Watching <a href="http://twitter.com/
ev">@ev</a> at <a href="http://search.twitter.com/search?q=
%23TED">#TED</a> talking about <a href="http://
search.twitter.com/search?q=%23Twitter">#<b>Twitter</
b></a>: <a href="http://ping.fm/IS0GK">http://ping.fm/
IS0GK</a></content>
<updated>2009-03-03T16:19:18Z</updated>
<link type="image/png" rel="image" href="http://s3.amazonaws.com/
twitter_production/profile_images/64875999/andyhand_normal.jpg"/>
<twitter:source><a href="http://www.ping.fm/">Ping.fm</
a></twitter:source>
<author>
<name>kaplanmyrth (Andy Kaplan-Myrth)</name>
<uri>http://twitter.com/kaplanmyrth</uri>
</author>
</entry>
<entry>
<id>tag:search.twitter.com,2005:1274320130</id>
<published>2009-03-03T16:19:18Z</published>
<link type="text/html" rel="alternate" href="http://twitter.com/
Phr0ztByte/statuses/1274320130"/>
<title>RT @shanselman: "Why I won't follow you on Twitter"
http://is.gd/eJrC</title>
<content type="html">RT <a href="http://twitter.com/
shanselman">@shanselman</a>: &quot;Why I won't follow you
on <b>Twitter</b>&quot; <a href="http://is.gd/
eJrC">http://is.gd/eJrC</a></content>
<updated>2009-03-03T16:19:18Z</updated>
<link type="image/png" rel="image" href="http://s3.amazonaws.com/
twitter_production/profile_images/56005704/thomas_normal.jpg"/>
<twitter:source><a href="http://
twitterfon.net/">TwitterFon</a></twitter:source>
<author>
<name>Phr0ztByte (Phr0ztByte)</name>
<uri>http://twitter.com/Phr0ztByte</uri>
</author>
</entry>
<entry>
<id>tag:search.twitter.com,2005:1274320065</id>
<published>2009-03-03T16:19:16Z</published>
<link type="text/html" rel="alternate" href="http://twitter.com/
jd_s/statuses/1274320065"/>
<title>Good Morning Tweeple !! (Twitter reference for you
facebookers out there)</title>
<content type="html">Good Morning Tweeple !! (<b>Twitter</
b> reference for you facebookers out there)</content>
<updated>2009-03-03T16:19:16Z</updated>
<link type="image/png" rel="image" href="http://s3.amazonaws.com/
twitter_production/profile_images/70818368/mad_robot_normal.png"/>
<twitter:source><a href="http://twitter.com/">web</a></
twitter:source>
<author>
<name>jd_s (jd_s)</name>
<uri>http://twitter.com/jd_s</uri>
</author>
</entry>
<entry>
<id>tag:search.twitter.com,2005:1274320062</id>
<published>2009-03-03T16:19:16Z</published>
<link type="text/html" rel="alternate" href="http://twitter.com/
seanrsullivan/statuses/1274320062"/>
<title>Twitter is now linked to Facebook. Social network marriage
made in heaven.</title>
<content type="html"><b>Twitter</b> is now linked to
Facebook. Social network marriage made in heaven.</content>
<updated>2009-03-03T16:19:16Z</updated>
<link type="image/png" rel="image" href="http://s3.amazonaws.com/
twitter_production/profile_images/76380071/coffee_normal.jpg"/>
<twitter:source><a href="http://www.atebits.com/software/
tweetie/">Tweetie</a></twitter:source>
<author>
<name>seanrsullivan (seanrsullivan)</name>
<uri>http://twitter.com/seanrsullivan</uri>
</author>
</entry>
<entry>
<id>tag:search.twitter.com,2005:1274320031</id>
<published>2009-03-03T16:19:16Z</published>
<link type="text/html" rel="alternate" href="http://twitter.com/
nighthawk24/statuses/1274320031"/>
<title>@thecancerus @iChaitanya:: The word 'blogger' is mentioned
in almost 95% of the twitter profiles me: till they started
microblogging!</title>
<content type="html"><a href="http://twitter.com/
thecancerus">@thecancerus</a> <a href="http://twitter.com/
iChaitanya">@iChaitanya</a>:: The word 'blogger' is mentioned
in almost 95% of the <b>twitter</b> profiles me: till they
started microblogging!</content>
<updated>2009-03-03T16:19:16Z</updated>
<link type="image/png" rel="image" href="http://static.twitter.com/
images/default_profile_normal.png"/>
<twitter:source><a href="http://
www.tweetdeck.com/">TweetDeck</a></twitter:source>
<author>
<name>nighthawk24 (aaditya bharadwaj)</name>
<uri>http://twitter.com/nighthawk24</uri>
</author>
</entry>
<entry>
<id>tag:search.twitter.com,2005:1274320004</id>
<published>2009-03-03T16:19:15Z</published>
<link type="text/html" rel="alternate" href="http://twitter.com/
sebensp3/statuses/1274320004"/>
<title>No, twitter is still lame.</title>
<content type="html">No, <b>twitter</b> is still
lame.</content>
<updated>2009-03-03T16:19:15Z</updated>
<link type="image/png" rel="image" href="http://static.twitter.com/
images/default_profile_normal.png"/>
<twitter:source><a href="http://
twitterfon.net/">TwitterFon</a></twitter:source>
<author>
<name>sebensp3 (Sara Ebensperger)</name>
<uri>http://twitter.com/sebensp3</uri>
</author>
</entry>
<entry>
<id>tag:search.twitter.com,2005:1274319854</id>
<published>2009-03-03T16:19:13Z</published>
<link type="text/html" rel="alternate" href="http://twitter.com/
mymm/statuses/1274319854"/>
<title>@morganlevy yikes. I think we must have had problems
deleting the direct message from Twitter so it kept resending. Seems
to be good now.</title>
<content type="html"><a href="http://twitter.com/
morganlevy">@morganlevy</a> yikes. I think we must have had
problems deleting the direct message from <b>Twitter</b>
so it kept resending. Seems to be good now.</content>
<updated>2009-03-03T16:19:13Z</updated>
<link type="image/png" rel="image" href="http://s3.amazonaws.com/
twitter_production/profile_images/59882269/twitter-avatar-
v1_normal.png"/>
<link type="application/atom+xml" rel="thread" href="http://
search.twitter.com/search/thread/1274319854.atom"/>
<twitter:source><a href="http://www.atebits.com/software/
tweetie/">Tweetie</a></twitter:source>
<author>
<name>mymm (MyMileMarker)</name>
<uri>http://twitter.com/mymm</uri>
</author>
</entry>
<entry>
<id>tag:search.twitter.com,2005:1274319829</id>
<published>2009-03-03T16:19:13Z</published>
<link type="text/html" rel="alternate" href="http://twitter.com/
mclovinlover/statuses/1274319829"/>
<title>@Juliette_Carter nm just got home i was at the store when
the boys twitter</title>
<content type="html"><a href="http://twitter.com/
Juliette_Carter">@Juliette_Carter</a> nm just got home i was
at the store when the boys <b>twitter</b></content>
<updated>2009-03-03T16:19:13Z</updated>
<link type="image/png" rel="image" href="http://s3.amazonaws.com/
twitter_production/profile_images/83979436/cookiem_normal.gif"/>
<link type="application/atom+xml" rel="thread" href="http://
search.twitter.com/search/thread/1274319829.atom"/>
<twitter:source><a href="http://twitter.com/">web</a></
twitter:source>
<author>
<name>mclovinlover (beth copeland)</name>
<uri>http://twitter.com/mclovinlover</uri>
</author>
</entry>
<entry>
<id>tag:search.twitter.com,2005:1274319814</id>
<published>2009-03-03T16:19:13Z</published>
<link type="text/html" rel="alternate" href="http://twitter.com/
P4Publishing/statuses/1274319814"/>
<title>Just set up my third twitter account - when does this count
as an addiction?</title>
<content type="html">Just set up my third <b>twitter</
b> account - when does this count as an addiction?</content>
<updated>2009-03-03T16:19:13Z</updated>
<link type="image/png" rel="image" href="http://s3.amazonaws.com/
twitter_production/profile_images/80675917/P4logo_normal.jpg"/>
<twitter:source><a href="http://
www.tweetdeck.com/">TweetDeck</a></twitter:source>
<author>
<name>P4Publishing (Tony Hetherington)</name>
<uri>http://twitter.com/P4Publishing</uri>
</author>
</entry>
</feed>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---