locked
How to parse media:content tag of RSS in ASPX page RRS feed

  • Question

  • User649904515 posted

    Hi all,

    I need to parse media element of RSS in ASPX PAGE ONLY, I can parse other tags directly using XMLDATASOURCE.

    <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="http://xyzblog.com/feed/"
                XPath="rss/channel/item"></asp:XmlDataSource>
            <asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1">
                <ItemTemplate>
                    <ul>
                        <li>
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#XPath("link")%>' Text='<%#XPath("title")%>'
                                CssClass="news-heading"></asp:HyperLink>
                            <br />
     </li>
                    </ul>
                </ItemTemplate>
            </asp:DataList>

    But I need to parse other some thing like below

    <asp:Label ID="lblDesc" runat="server" Text='<%#XPath("media:content[1]/@url")%>'></asp:Label>

    How can I do that ?

    I'm trying to parse below tag

    <media:content medium="image" url="http://0.gravatar.com/avatar/0b799e465686f257e900e6bbc3deefd4?s=96&d=retro"> <media:title type="html">cainm</media:title>


     

    Tuesday, July 24, 2012 9:32 AM

All replies

  • User-1488931086 posted

    1)

     <asp:xmldatasource runat="server" id="xds1"
    datafile="~/app_data/namespacebooks.xml"
    xpath="/ba:store/dx:book">
    <asp:namespace prefix="media" name=”your url namespace here……” />
    </asp:xmldatasource>

    Sunday, July 29, 2012 5:17 AM