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

  • SEARCH
  • Home
  • 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 8247989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:02:42+00:00 2026-06-07T23:02:42+00:00

I have an xml feed from Gmail as such: <feed version=0.3> <title>Gmail – Inbox

  • 0

I have an xml feed from Gmail as such:

<feed version="0.3">
    <title>Gmail - Inbox for bagee18@gmail.com</title>
    <tagline>New messages in your Gmail Inbox</tagline>
    <fullcount>9</fullcount>
    <link rel="alternate" href="http://mail.google.com/mail" type="text/html"/>
    <modified>2012-07-19T02:43:55Z</modified>
    <entry>
      <title>$50 or $100 Nightly Resort Credit and Room Upgrade</title>
      <summary>Add to Address Book | Update email address Marriott® FIND A HOTEL EXPLORE  PLAN MARRIOTT REWARDS</summary>
      <link rel="alternate" href="http://.google.com" type="text/html"/><modified>2012-07-19T01:23:00Z</modified>
      <issued>2012-07-19T01:23:00Z</issued>
      <id>tag:gmail.google.com,2004:1407882080256681207</id>
      <author>
          <name>Marriott</name>
          <email>Marriott@marriott-email.com</email>
      </author>
    </entry>
    <entry>
      <title>Tim Anderson's ITWriting » Blog Archive Resort » Moving a database from on-premise SQL Server to SQL Azure: some hassle</title>
      <summary>Tim Anderson's ITWriting Tech writing blog Home Articles Reviews Gadget Writing Forthcoming</summary>
      <link rel="alternate" href="http://google.comen" type="text/html"/><modified>2012-07-19T00:55:25Z</modified>
      <issued>2012-07-19T00:55:25Z</issued>
      <id>tag:gmail.google.com,2004:1407880344364808586</id>
        <author>
          <name>me</name>
          <email>bagee18@gmail.com</email>
        </author>
    </entry>          

I created a LinqPad query as such:

XDocument xmlDoc = XDocument.Load(@"C:\Users\Brad Agee\Documents\feeds.xml");

var q = from c in xmlDoc.Descendants("entry")
where c.Element("title").Value.ToLower().Contains("resort")
select new {
name = c.Element("title").Value,
url = ??,
email ??
};

q.Dump();

How can I extract the value of href attribute of the link tag into the url property and the value of email attribute into the email property?

  • 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-06-07T23:02:45+00:00Added an answer on June 7, 2026 at 11:02 pm

    Well.
    Href is an attribute of the element link.
    So

    c.Element("link").Attribute("href")
    

    email is an element of the element author

    So

    c.Element("auhtor").Element("email").Value
    

    finally

    select new
    {
        name = c.Element("title").Value,
        url = c.Element("link").Attribute("href").Value,
        email = c.Element("author").Element("email").Value 
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML feed coming in: <?xml version=1.0 encoding=UTF-8?><product> <name>John</name> <contact_email>john@johnson.com</contact_email> <contact_telephone>01234 567</contact_telephone>
I have this xml. <?xml version=1.0 encoding=utf-8?> <feed xml:lang=el-gr xmlns=http://www.w3.org/2005/Atom> <title type=text>name.gr</title> <updated>2011-07-23</updated> <link
I have my XML feed being created from an associative array. Using new DOMDocument('1.0','UTF-8');
Basically I have an xml feed from an offsite server. The xml feed has
I have a NSString which is passed from an xml feed........ NSString *strDate =@May
I have a NSString which is passed from an xml feed........ NSString *strDate =@Thu,
I have an xml feed which I need to access an element from. However,
I have XML shaped like the following: <?xml version=1.0 encoding=UTF-8?> <feed xmlns=http://www.w3.org/2005/Atom xmlns:openSearch=http://a9.com/-/spec/opensearch/1.1/ xmlns:docs=http://schemas.google.com/docs/2007
I have the xml code: <feed xml:base=https://test.net/ xmlns:d=http://schemas.microsoft.com/ado/2007/08/dataservices xmlns:m=http://schemas.microsoft.com/ado/2007/08/dataservices/metadata xmlns=http://www.w3.org/2005/Atom> <title type=text>CustomTable5</title> <id>https://eqmetest.table.core.windows.net/CustomTable5</id> <updated>2011-11-15T11:36:32Z</updated>
I have an xml feed from Google Contacts API, but I have trouble reading

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.