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

Related Questions

I am reading XML using xmlreader, and then binding the xml to a Repeater
I retrieve XML from a server, save it into an SD card, then parse
My program basically looks like this: using(XmlReader reader = XmlReader.Create(File.Open(path, FileMode.Open, FileAccess.Reader, FileShare.Read)) {
I am using XMLReader to read a large XML file with about 1 million
I want to save and load my xml data using XmlReader. But I don't
The code: using (XmlReader xmlr = XmlReader.Create(new StringReader(allXml))) { var items = from item
I read xml-string using XmlReader with code: XmlReader reader = XmlReader.Create(new StringReader(xmlString)); while (reader.Read())
I have read rss feed by below function using (XmlReader reader = XmlReader.Create(feedUri.AbsoluteUri)) but
I'm having some trouble using XmlReader to read an XML file. I can open
I've got this XML file that I am parsing using the parser here and

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.