List Info

Thread: help with .net code?




help with .net code?
country flaguser name
United States
2008-03-07 00:37:03

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>
 &nbsp; <title&gt;ohYeah&lt;/title>;
 &nbsp; <link&gt;</link>
   <description>&lt;/description>
&nbsp;  <pubDate></pubDate>
  ; <dc:date.Taken></dc:date.Taken>
 &nbsp; <author></author>
&nbsp;  <guid isPermaLink="false"&gt;</guid>
 ;  <media:content />
&nbsp;  <media:title>&lt;/media:title>
&nbsp;  <media:text type="html"></media:text&gt;
 &nbsp; <media:thumbnail&nbsp;  />
&nbsp;  <media:credit role="photographer"&gt;s</media:credit&gt;
 &nbsp; <media:category scheme="urn:f lickr:tags"></media:category>
</item>

2.  Here is the .net code:
<;form id="form1" runat="server">
&nbsp; &nbsp; <div style="border:solid 4px black;">;
 &nbsp;  
&nbsp; &nbsp; </div&gt;
 &nbsp;  <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile='http://api.flickr.com/services/feeds/photos_public.gne?id=15088000N00&format=rss_200' XPath="rss/channel/item">&lt;/asp:XmlDataSource&gt;
 &nbsp;   ;   
&nbsp; &nbsp; &nbsp;   <aspataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1"&gt;
 &nbsp; &nbsp;   ; <ItemTemplate>&lt;a href='<%# XPath("link") %>'><%#XPath("title")%><%#XPath("/media:title", manager)%&gt;</ItemTemplate&gt;
 &nbsp;   ;& nbsp; ; </aspataList>;
 &nbsp;  </form&gt;

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
&nbsp; &nbsp;   ;  manager = New System.Xml.XmlNamespaceManager(New System.Xml.NameTable)
 &nbsp; &nbsp; &nbsp;  manager.AddNamespace("media", "http://search.yahoo.com/mrss")

 &nbsp;  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.

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )