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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:08:31+00:00 2026-05-26T05:08:31+00:00

I have a rather complex XML document <ItemSearchResponse xmlns=——-> <OperationRequest> <HTTPHeaders> </HTTPHeaders> <RequestId>0S57WGDPNC7T8HNBV76K</RequestId> <Arguments>

  • 0

I have a rather complex XML document

<ItemSearchResponse xmlns="-------">
  <OperationRequest>
    <HTTPHeaders>
    </HTTPHeaders>
    <RequestId>0S57WGDPNC7T8HNBV76K</RequestId>
    <Arguments>
    </Arguments>
    <RequestProcessingTime>0.441776990890503</RequestProcessingTime>
  </OperationRequest>
  <Items>
    <Request>
      <ItemSearchRequest>
      </ItemSearchRequest>
    </Request>
    <TotalResults>1020</TotalResults>
    <TotalPages>102</TotalPages>
    <Item>
      <ASIN>B004WL0L9S</ASIN>
      <SalesRank>1</SalesRank>
      <ItemAttributes>
         <Manufacturer>Georgia Pacific Consumer Products LP (Cut-Sheet Paper)</Manufacturer>
         <Title>GP Copy &amp; Print Paper, 8.5 x 11 Inches Letter Size, 92 Bright White, 20    Lb, Ream of 500 Sheets (998067R)</Title>
      <ItemAttributes>
    </Item>
  <Items>

I run this query over it and it returns of list of zero:

XDocument doc = XDocument.Load(url);
List<Item> Items = (from c in doc.Elements("Item")
          select new Item
          {
            Title = c.Element("Title").Value
            SaleRank = c.Element("SaleRank").Value
            ASIN = c.Element("ASIN").Value
           }).ToList<Item>();

I am really new to XLinq but according to the documentation that should work.

  • 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-26T05:08:32+00:00Added an answer on May 26, 2026 at 5:08 am

    Turns out I need to add the namespace to query.

    XNamespace ns = NAMESPACE;
    
    var items = (from c in doc.Descendants(ns +"Item")
        select new Item
        {
           Title = c.Element(ns + "ItemAttributes").Element(ns + "Title").Value,
           SalesRank = c.Element(ns +"SalesRank").Value,
           ASIN = c.Element(ns + "ASIN").Value
        }).ToList<Item>();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a rather complex XML document. I have a bunch of
I have a number rather large, complex xml documents that I need to loop
I have a rather complex decorator written by someone else. What I want to
I have to buil a rather complex WPF UI (a hughe Grid) in code
We have a rather large and complex application written in Java which is running
I have a rather large and complex game in C#, and in it are
I have a hash table where the keys are rather complex lists, with sublists
I have a PHP class that stores a complex multidimensional array, and rather than
I have rather large input XML files that must be converted to a given
I have a rather complex ListView, with variable list item heights. Under certain conditions,

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.