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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:11:43+00:00 2026-06-12T03:11:43+00:00

My XML Response: <Items> <Item> <ASIN>1212121</ASin> <ItemAttributes> <Title>aaaa</Title> </ItemAttributes> <Variations> <Item> <ItemAttributes> <color>Red</color> </ItemAttributes>

  • 0

My XML Response:

<Items>
<Item>
<ASIN>1212121</ASin>
 <ItemAttributes>
  <Title>aaaa</Title>
  </ItemAttributes>
  <Variations>
   <Item>
    <ItemAttributes>
     <color>Red</color>
     </ItemAttributes>
     </Item>
     Item>
    <ItemAttributes>
     <color>yellow</color>
     </ItemAttributes>
     </Item>
       Item>
    <ItemAttributes>
     <color>pink</color>
     </ItemAttributes>
     </Item>
      </Variations>
    </Item>
  <Item>
   ASIN>1211111</ASin>
 <ItemAttributes>
  <Title>bbb</Title>
  </ItemAttributes>
  <Variations>
   <Item>
    <ItemAttributes>
     <color>Green</color>
     </ItemAttributes>
     </Item>
      </Variations>
  </Item>
  </Items>

Here, I received ten Item Per Page. All i need now, to Get the color of each Item.
I used the following code.

   var Color = xd.Descendants(ns + "Items").Elements(ns+"Item").Elements(ns + "Variations").Elements(ns + "Item").Elements(ns + "ItemAttributes").Elements(ns + "Color").Select(cl => new
        {
            clr = cl.Value
        }).ToList();

This Xml Return the color of all Item. In first it is red.
In second it is green. It goes upto item ten.
Now my above LINQ code return color for all Item., It return as Red,yellow.pink,green..
But I have to show the color of first item (Red) separately.

Finally,
i have to show items->Item->Variations->Item->ItemAttributes->color
Output: For First Item., Red,Yellow,Pink
For second item , Green,..

  • 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-12T03:11:44+00:00Added an answer on June 12, 2026 at 3:11 am

    Try with,

       var Color = xd.Descendants(ns + "Items").Elements(ns + "Item").Select(o => string.Join(",", o.Elements(ns + "Variations")
                .Elements(ns + "Item")
                .Elements(ns + "ItemAttributes")
                .Elements(ns + "Color")
                .Select(x => x.Value).ToArray())).ToList<string>();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have stored the XML path to items in a string like this: response->items->item
Here is my XML Response: <DIDL-Lite xmlns=urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/ xmlns:dc=http://purl.org/dc/elements/1.1/ xmlns:upnp=urn:schemas-upnp-org:metadata-1-0/upnp/ <item id=1182 parentID=40 restricted=1> <title>Hot
XML response <?xml version=1.0 encoding=UTF-8 standalone=yes ?> - <Film> <film_id>1</film_id> <title>ACADEMY DINOSAUR</title> <description>xxx</description> <length>86</length>
I have this xml response to which I will do a foreach($response->entry->item as $data)
Hello I have an api response in xml format with a series of items
I'm receiving an xml response and I now want to parse this. Currently what
I have an XML response that I'd like to bind and display to a
I have an getting an xml response on this format <?xml version=\1.0\ encoding=\utf-8\?>\r\n <PlatformResponse
We have implemented webservice which generates xml response. I am facing issue while invoking
I'm using Nokogiri to parse an XML response from last.fm. I am currently returning

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.