I am sure this is just a function of my xml illiteracy, but after several hours of combing the net, I have code that according to the examples should work, but does not.
1. Here is the flickr xml structure I am using:
<item>
<title>ohYeah</title>
<link></link>
<description></description>
<pubDate></pubDate>
<dc:date.Taken></dc:date.Taken>
<author></author>
<guid isPermaLink="false"></guid>
<media:content />
<media:title></media:title>
<media:text type="html"></media:text>
<media:thumbnail />
<media:credit role="photographer">s</media:credit>
<media:category scheme="urn:f
lickr:tags"></media:category>
</item>
2. Here is the .net code:
<form id="form1" runat="server">
<div style="border:solid 4px black;">
</div>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile='http://api.flickr.com/services/feeds/photos_public.gne?id=15088000
N00&format=rss_200' XPath="rss/channel/item"></asp:XmlDataSource>
<asp
ataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1">
<ItemTemplate><a href='<%# XPath("link") %>'><%#XPath("title")%><%#XPath("/media:title", manager)%></ItemTemplate>
&
nbsp; </asp
ataList>
</form>
3. Here is the code-behind:
Public manager As System.Xml.XmlNamespaceManager
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
manager = New System.Xml.XmlNamespaceManager(New System.Xml.NameTable)
manager.AddNamespace("media", "http://search.yahoo.com/mrss")
End Sub
Every example I have seen says you need to load the namespace into the namespace manager, and then reference that manager in the xpath call, as above: #XPath("/media:title", manager)
I've tried several different ways of doing the XPath syntax, no matter what I do, I can't get any media:XXX elements to appear in the code.
I am fundamentally missing something.
Could anyone help, it would be most appreciated. Thanks.
.