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 7663939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:10:33+00:00 2026-05-31T14:10:33+00:00

I have an xml like <?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′ xmlns:batch=’http://schemas.google.com/gdata/batch’ xmlns:gd=’http://schemas.google.com/g/2005′

  • 0

I have an xml like

<?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' xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='W/&quot;C0EARXY8eit7ImA9WhVREE0.&quot;'>

<id>https://docs.google.com/feeds/default/private/full</id>
<updated>2012-03-17T16:27:24.872Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/docs/2007#item' label='item'/>

<title>Available Documents - </title>

<link rel='alternate' type='text/html' href='https://docs.google.com'/>
<link rel='http://schemas.google.com/g/2005#resumable-create-media' type='application/atom+xml' href='https://docs.google.com/feeds/upload/create-session/default/private/full'/>
<link rel='http://schemas.google.com/docs/2007#alt-post' type='application/atom+xml' href='https://docs.google.com/feeds/upload/file/default/private/full'/>
<link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://docs.google.com/feeds/default/private/full'/>
<link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='https://docs.google.com/feeds/default/private/full'/>
<link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml' href='https://docs.google.com/feeds/default/private/full/batch'/>
<link rel='self' type='application/atom+xml' href='https://docs.google.com/feeds/default/private/full/-/document'/>

<some more tags />

<entry gd:etag='&quot;E0UXTh9YDSt7ImBr&quot;'>
<some more tags />
<title>hi</title>
<link rel='http://schemas.google.com/docs/2007#parent' type='application/atom+xml' href=''/>
<link rel='alternate' type='application/atom+xml' href=''/>
<link rel='http://schemas.google.com/docs/2007#embed' type='application/atom+xml' href=''/>
<link rel='http://schemas.google.com/docs/2007#icon' type='application/atom+xml' href=''/>
<link rel='http://schemas.google.com/g/2005#resumable-edit-media' type='application/atom+xml' href=''/>
<link rel='http://schemas.google.com/docs/2007#alt-edit-media' type='application/atom+xml' href=''/>
<link rel='http://schemas.google.com/docs/2007/thumbnail' type='application/atom+xml' href=''/>
<link rel='self' type='application/atom+xml' href=''/>
<link rel='edit' type='application/atom+xml' href=''/>
<link rel='edit-media' type='application/atom+xml' href=''/>
...
<some more tags />
...
</entry>
<entry>
...
</entry>
...

I want to fetch the attribute href of the element <link> whose rel="http://schemas.google.com/g/2005#resumable-create-media"

What I’m doing right now is I’m getting list of nodes with xmlnode = doc.GetElementsByTagName("link"); then I’m iterating through all of them and fetching the first one whose rel="http://schemas.google.com/g/2005#resumable-create-media"

So essentially I’m looping through all the nodes <link> when I’m just interested in those which are next child of node <feed> and are not inside node <entry>.
A <feed> have multiple <entry> nodes which in turn have multiple <link> tags.
And instead I would like to just get the list of <link> which are directly in <feed> and not in <entry>.

Any help would be appreciated.

  • 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-31T14:10:35+00:00Added an answer on May 31, 2026 at 2:10 pm

    I typically use the System.Xml.Linq.XElement classes for working with xml in C#. If I understand your problem, it could look like this:

    XElement input = XElement.Load(filename);
    foreach(XElement feedChild in input.Elements("feed"))
      foreach(XElement linkChild in feedChild.Elements("link"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a xml like this: <?xml version=1.0 encoding=utf-8?> <assessment xmlns=http://xml.thinkcentral.com/pub/xml/hsp/assessment xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xhtml=http://www.w3.org/1999/xhtml xmlns:tia=http://xml.thinkcentral.com/pub/xml/hsp/tia
I have an XML file that looks like <?xml version='1.0' encoding='UTF-8'?> <root> <node name=foo1
have an xml file like this. <?xml version =1.0 encoding =utf-8?> <menu> <menuNode title=Register
I have an xml file which looks like this <?xml version=1.0 encoding=UTF-8 ?> <BulkDataExchangeRequests
My XML looks like this: <?xml version = 1.0 encoding = utf-8?> <gallery> <name>Rosie's
I have the following XML: <?xml version=1.0 encoding=UTF-8?> <game> <name>Space Blaster</name> <description></description> <version>1</version> <fullscreen>false</fullscreen>
Let's suppose I have xml like this one: <Server Active=No> <Url>http://some.url</Url> </Server> C# class
I have a XML file that looks like this <Licence> <Name>Test company</Name> <Version>1.1.1.1</Version> <NumberOfServer>2</NumberOfServer>
I have xml input which looks like (simplified version used for example): <Student> <Subject>
I have hash(Hash.from_xml) which looks like this (from inspect): { FileName=>hofplayers.xml, Version=>1.0, UserID=>3955847, FetchedDate=>2011-08-16

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.