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&amp;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&amp;page=2&amp;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 &lt;a href="http://twitter.com/
ev"&gt;@ev&lt;/a&gt; at &lt;a href="http://search.twitter.com/search?q=
%23TED"&gt;#TED&lt;/a&gt; talking about &lt;a href="http://
search.twitter.com/search?q=%23Twitter"&gt;#&lt;b&gt;Twitter&lt;/
b&gt;&lt;/a&gt;: &lt;a href="http://ping.fm/IS0GK"&gt;http://ping.fm/
IS0GK&lt;/a&gt;</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>&lt;a href="http://www.ping.fm/"&gt;Ping.fm&lt;/
a&gt;</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 &lt;a href="http://twitter.com/
shanselman"&gt;@shanselman&lt;/a&gt;: &amp;quot;Why I won't follow you
on &lt;b&gt;Twitter&lt;/b&gt;&amp;quot;  &lt;a href="http://is.gd/
eJrC"&gt;http://is.gd/eJrC&lt;/a&gt;</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>&lt;a href="http://
twitterfon.net/"&gt;TwitterFon&lt;/a&gt;</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 !! (&lt;b&gt;Twitter&lt;/
b&gt; 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>&lt;a href="http://twitter.com/"&gt;web&lt;/a&gt;</
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">&lt;b&gt;Twitter&lt;/b&gt; 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>&lt;a href="http://www.atebits.com/software/
tweetie/"&gt;Tweetie&lt;/a&gt;</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">&lt;a href="http://twitter.com/
thecancerus"&gt;@thecancerus&lt;/a&gt; &lt;a href="http://twitter.com/
iChaitanya"&gt;@iChaitanya&lt;/a&gt;:: The word 'blogger' is mentioned
in almost 95% of the &lt;b&gt;twitter&lt;/b&gt; 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>&lt;a href="http://
www.tweetdeck.com/"&gt;TweetDeck&lt;/a&gt;</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, &lt;b&gt;twitter&lt;/b&gt; 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>&lt;a href="http://
twitterfon.net/"&gt;TwitterFon&lt;/a&gt;</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">&lt;a href="http://twitter.com/
morganlevy"&gt;@morganlevy&lt;/a&gt; yikes. I think we must have had
problems deleting the direct message from &lt;b&gt;Twitter&lt;/b&gt;
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>&lt;a href="http://www.atebits.com/software/
tweetie/"&gt;Tweetie&lt;/a&gt;</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">&lt;a href="http://twitter.com/
Juliette_Carter"&gt;@Juliette_Carter&lt;/a&gt; nm just got home i was
at the store when the boys &lt;b&gt;twitter&lt;/b&gt;</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>&lt;a href="http://twitter.com/"&gt;web&lt;/a&gt;</
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 &lt;b&gt;twitter&lt;/
b&gt; 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>&lt;a href="http://
www.tweetdeck.com/"&gt;TweetDeck&lt;/a&gt;</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 Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to