01-27-2013 04:39 AM
I have the following XML retrieved from twitter:
<statuses type="array">
<status>
<created_at>Fri Jan 25 15:47:45 +0000 2013</created_at>
<id>294833948821954560</id>
<text>Looking for a replacement for v1's friendships/no_retweet_ids? v1.1 now has an equivalent: https://t.co/gILO7b0U ^TS</text>
<source>web</source>
<truncated>false</truncated>
<in_reply_to_status_id></in_reply_to_status_id>
<in_reply_to_user_id></in_reply_to_user_id>
<in_reply_to_screen_name></in_reply_to_screen_name >
<possibly_sensitive>false</possibly_sensitive>
<user>
<id>6253282</id>
<name>Twitter API</name>
<screen_name>twitterapi</screen_name>
<location>San Francisco, CA</location>
<profile_image_url>http://a0.twimg.com/profile_images/2284174872/7df3 h38zabcvjylnyfe3_normal.png</profile_image_url>
<profile_image_url_https>https://si0.twimg.com/profile_images/2284174872/7d f3h38zabcvjylnyfe3_normal.png</profile_image_url_https>
<url>http://dev.twitter.com</url>
<description>The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.</description>
<protected>false</protected>
<followers_count>1453582</followers_count>
<profile_background_color>C0DEED</profile_backgrou nd_color>
<profile_text_color>333333</profile_text_color>
<profile_link_color>0084B4</profile_link_color>
<profile_sidebar_fill_color>DDEEF6</profile_sideba r_fill_color>
<profile_sidebar_border_color>C0DEED</profile_side bar_border_color>
<friends_count>33</friends_count>
<created_at>Wed May 23 06:01:13 +0000 2007</created_at>
<favourites_count>25</favourites_count>
<utc_offset>-28800</utc_offset>
<time_zone>Pacific Time (US & Canada)</time_zone>
<profile_background_image_url>http://a0.twimg.com/profile_background_images/6569 27849/miyt9dpjz77sc0w3d4vj.png</profile_background_image_url>
<profile_background_image_url_https>https://si0.twimg.com/profile_background_images/65 6927849/miyt9dpjz77sc0w3d4vj.png</profile_background_image_url_https>
<profile_background_tile>true</profile_background_ tile>
<profile_use_background_image>true</profile_use_ba ckground_image>
<geo_enabled>true</geo_enabled>
<verified>true</verified>
<statuses_count>3370</statuses_count>
<lang>en</lang>
<contributors_enabled>true</contributors_enabled>
<is_translator>false</is_translator>
<listed_count>11219</listed_count>
<default_profile>false</default_profile>
<default_profile_image>false</default_profile_imag e>
<following></following>
<follow_request_sent></follow_request_sent>
<notifications></notifications>
</user>
<geo/>
<coordinates/>
<place/>
<contributors>
<user_id>819797</user_id>
</contributors>
<retweet_count>33</retweet_count>
<favorited>false</favorited>
<retweeted>false</retweeted>
</status>
<status>
<created_at>Tue Jan 22 23:03:46 +0000 2013</created_at>
<id>293856509547388929</id>
<text>We expect our user IDs to exceed the signed 32-bit boundary sometime this year. Time to move to 64-bit: https://t.co/U3zYCnOR ^ARK</text>
<source>web</source>
<truncated>false</truncated>
<in_reply_to_status_id></in_reply_to_status_id>
<in_reply_to_user_id></in_reply_to_user_id>
<in_reply_to_screen_name></in_reply_to_screen_name >
<possibly_sensitive>false</possibly_sensitive>
<user>
<id>6253282</id>
<name>Twitter API</name>
<screen_name>twitterapi</screen_name>
<location>San Francisco, CA</location>
<profile_image_url>http://a0.twimg.com/profile_images/2284174872/7df3 h38zabcvjylnyfe3_normal.png</profile_image_url>
<profile_image_url_https>https://si0.twimg.com/profile_images/2284174872/7d f3h38zabcvjylnyfe3_normal.png</profile_image_url_https>
<url>http://dev.twitter.com</url>
<description>The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.</description>
<protected>false</protected>
<followers_count>1453582</followers_count>
<profile_background_color>C0DEED</profile_backgrou nd_color>
<profile_text_color>333333</profile_text_color>
<profile_link_color>0084B4</profile_link_color>
<profile_sidebar_fill_color>DDEEF6</profile_sideba r_fill_color>
<profile_sidebar_border_color>C0DEED</profile_side bar_border_color>
<friends_count>33</friends_count>
<created_at>Wed May 23 06:01:13 +0000 2007</created_at>
<favourites_count>25</favourites_count>
<utc_offset>-28800</utc_offset>
<time_zone>Pacific Time (US & Canada)</time_zone>
<profile_background_image_url>http://a0.twimg.com/profile_background_images/6569 27849/miyt9dpjz77sc0w3d4vj.png</profile_background_image_url>
<profile_background_image_url_https>https://si0.twimg.com/profile_background_images/65 6927849/miyt9dpjz77sc0w3d4vj.png</profile_background_image_url_https>
<profile_background_tile>true</profile_background_ tile>
<profile_use_background_image>true</profile_use_ba ckground_image>
<geo_enabled>true</geo_enabled>
<verified>true</verified>
<statuses_count>3370</statuses_count>
<lang>en</lang>
<contributors_enabled>true</contributors_enabled>
<is_translator>false</is_translator>
<listed_count>11219</listed_count>
<default_profile>false</default_profile>
<default_profile_image>false</default_profile_imag e>
<following></following>
<follow_request_sent></follow_request_sent>
<notifications></notifications>
</user>
<geo/>
<coordinates/>
<place/>
<contributors>
<user_id>7588892</user_id>
</contributors>
<retweet_count>253</retweet_count>
<favorited>false</favorited>
<retweeted>false</retweeted>
</status>
</statuses>
I have tried using ListItemComponents to display the tweet text to no avail:
ListView
{
objectName: "twitterLSTVW"
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
layout: FlowListLayout {}
dataModel: XmlDataModel {source: "model.xml"}
listItemComponents: [
ListItemComponent
{
type: "status"
Container
{
id: item
Label { text: ListItem.text.data }
}
}
]
}
I have tried looking for examples but all of them include models that just use attributes and are not really nested.
If someone could please provide me with the right code to the listItemComponents.
Thanks!
01-28-2013 02:08 PM - edited 01-28-2013 03:06 PM
Maybe it can only support for the tag with attributes. Like this one:
<root>
<item title="BlackBerry Dev" feedlink="http://feeds.feedburner.com/blackberry/CAxx?format =xml"/>
<item title="Open BB News" feedlink="http://openbbnews.wordpress.com/feed/"/>
</root>
Your provided XML format is different. You can have a try with a customized datasource to read XML.
See the sample codes : rssnews and tldr
The official document for DataSource is located at