Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1001637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:42:23+00:00 2026-05-16T07:42:23+00:00

I am using XmlReader.Create to retrieve data from an RSS xml file. Then I

  • 0

I am using XmlReader.Create to retrieve data from an RSS xml file. Then I am putting this data into a DataSet and binding it to a ListView:

XmlReader xmlReader = XmlReader.Create(this.RssUrl);
XmlDataDocument xdoc = new XmlDataDocument();
xdoc.DataSet.ReadXml(xmlReader, XmlReadMode.InferSchema);

The problem is that one of the fields I am trying to get is in an attribute. How do I get the “url” attribute from “media:thumbnail” below?

<item> 
  <title>Some Title</title> 
  <description>Content goes here...</description> 
  <link>http://www.mydomain.com?id=439</link> 
  <guid>453252362</guid> 
  <pubDate>Sat, 21 Aug 2010 11:00:00 GMT</pubDate> 
  <media:thumbnail url="http://www.mydomain.com/catalog/1111tn.jpg" /> 
  <media:content url="http://www.mydomain.com/catalog/1111.jpg" /> 
</item> 

I am bind it like this, but the media:thumbnail is null obviously because I need to get the attribute some how:

void singleItem_DataBinding(object sender, System.EventArgs e)
{
    Label singleItem = (Label)sender;
    singleItem.Text = String.Format(@"                    
        <div class=""rlvI content"">
            <div class=""image"">
                <a href=""{0}""><img src=""{1}"" alt=""{2}""></a>
            </div>
            <p>
                <span class=""title"">{2}</span><br />
                {3}
            </p>
        </div>",
        ((singleItem.NamingContainer as RadListViewDataItem).DataItem as DataRowView)["link"],
        ((singleItem.NamingContainer as RadListViewDataItem).DataItem as DataRowView)["media:thumbnail"],
        ((singleItem.NamingContainer as RadListViewDataItem).DataItem as DataRowView)["title"],
        ((singleItem.NamingContainer as RadListViewDataItem).DataItem as DataRowView)["description"]);
}

Can anyone help with this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:42:24+00:00Added an answer on May 16, 2026 at 7:42 am

    How do I get the “url” attribute from “media:thumbnail” below?

    You need to read through the document (while (xmlReader.Read() {...}) until you get to the element with the attribute on it. Then you can use methods like ReadAttributeValue.

    In the read loop you can match on node type, node name and namespace to ensure you have the right element.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 506k
  • Answers 506k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you want it for an abort, you should perhaps… May 16, 2026 at 3:51 pm
  • Editorial Team
    Editorial Team added an answer Assuming your XmlDocument is called doc, then the following should… May 16, 2026 at 3:51 pm
  • Editorial Team
    Editorial Team added an answer Have a look at this question: ASP.NET - Url Rewriting… May 16, 2026 at 3:51 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am reading XML using xmlreader, and then binding the xml to a Repeater
The code: using (XmlReader xmlr = XmlReader.Create(new StringReader(allXml))) { var items = from item
I am using XmlReader to validate a XML file as per the supplied schema.
I am calling 5 external servers to retrieve XML-based data for each request for
I am using an RSS feed as a data source. I've adjusted how I
I have a program where it reads and writes XML using XMLReader and XMLWriter
I would like to learn the difference between XMLReader.Create and new XMLTextReader() to read
In the following snippet, using XmlReader, when I encounter an element. I would like
I have the following method GetData that creates a StreamReader from a file. private
I am trying to parse an XML response from a website in C#. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.