Binding to XML in Blend (what am I missing)

Binding to XML in Blend (what am I missing)

Post by johnn » Sat, 09 Jun 2007 05:01:53


So I am trying to create a simple ListBox in Blend which is bound to an
RSS feed using the method as seen in the Tutorial here:

http://www.yqcomputer.com/


However, I am seeing weird things happen with different RSS feeds, and I
can't figure out what is going on.

The steps are really simple, and are as follows:


* Click on +XML button in the Data Pane of the Project Panel
* Paste in an RSS URL
* Find the part of the RSS feed which defines each item - usually item
(Array) - and drag this onto your Application Window Grid - and select
ListBox from the list of controls to map the data to.
* Select OK in the Create Data Binding dialog to Bind the XML data to
the ItemsSource of the ListBox
* Select the items you want to display in your Data Template

These steps are trivial - however it seems very particular about what
kind of RSS feeds this works with - and I can't figure out why some work
and some don't.

Ones that works:

http://www.yqcomputer.com/

http://www.yqcomputer.com/



Several that don't:

http://www.yqcomputer.com/

http://www.yqcomputer.com/


For the Curbed feed, it appears the XML parser is successful at figuring
out the XML format, however, when you get to defining the DataTemplate
no data actually shows up in the Preview pane (when using the "entry"
field to define the Data Template)

Note that when you try to use the Digg RSS feed, Blend kinda goes into
never-never-land for a long time, and when it finally comes back, the
XML data source has no expansion capabilities - i.e. the tree view you
would expect to see to drill down into the XML format is not a tree view.


Any ideas what is going on?
 
 
 

Binding to XML in Blend (what am I missing)

Post by QnJlbm5vbi » Sat, 09 Jun 2007 21:43:01

Howdy Johnny,

Are you creating a different datatemplate for each feed? The structures of
the RSS feeds differ and it is only by co-incidence that you are able to see
some and not others.

Cheers
--
http://www.yqcomputer.com/
http://www.yqcomputer.com/
http://www.yqcomputer.com/

 
 
 

Binding to XML in Blend (what am I missing)

Post by johnn » Sat, 09 Jun 2007 23:56:01

Yes, I am creating a new Data Template for each feed and creating a new
DataProvider for each feed as well. It seems as though this is a
possibly a bug in the "Infer Schema from Data" operation.

The interesting thing to note is that when you create a DataProvider for
the Digg feed and leave the default setting to Infer Schema from Data -
it takes an unusually long time to process the feed (on the order of
several minutes - Blend actually hangs during this process) - and when
it comes back, the DataProvider that is usually listed in a TreeView has
no expansion.

It is really simple to verify this:

1) Create a new project in Blend
2) Click on the +XML in the Data Pane to add a DataProvider
3) Paste in the Digg feed: http://www.yqcomputer.com/

Blend goes by-by for several minutes and obviously fails to infer the
Schema from the data.
 
 
 

Binding to XML in Blend (what am I missing)

Post by QnJlbm5vbi » Sun, 10 Jun 2007 00:34:00

Thanks Johnny,

I didnt want to assume anything in terms of you creating new datatemplates
etc... so good to hear that you are.

Right you are in regards to the hang... still waiting for mine to regain
consciouness from that effort...

The only thing that maybe causing some issues is because the digg feed uses
its own schema to define its tags, and I wonder if this is confusing Blend..

<rss version="2.0" xmlns:digg=" http://www.yqcomputer.com/ ">

A visit to connect is in order for you... can you please list this as a
defect.

Cheers
--
http://www.yqcomputer.com/
http://www.yqcomputer.com/
http://www.yqcomputer.com/
 
 
 

Binding to XML in Blend (what am I missing)

Post by johnn » Sun, 10 Jun 2007 04:02:58

Done!