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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:53:33+00:00 2026-06-11T02:53:33+00:00

I am using AWS in my webapplication. I got the WS response. Xml response

  • 0

I am using AWS in my webapplication. I got the WS response.

Xml response :

 <ItemSearchRespone xmlns="http:/....">
  <Items>
   <Item>
  <ASIN>B003MC5N28</ASIN>
  <DetailPageURL>http://www.amazon.com/Giver-Newbery-Medal-Book-ebook/dp/B003MC5N28%3FSubscriptionId%3DAKIAIETT7RP2RAFF4UUQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB003MC5N28</DetailPageURL>
  <SalesRank>469</SalesRank>
   **<ItemAttributes>**
      <Address>
      <Country>us</Country>
      </Address>
    <Author>Lois Lowry</Author>
    <Binding>Kindle Edition</Binding>
    <Country>us</Country>
    <Format>Kindle eBook</Format>
    <Label>Houghton Mifflin Books for Children</Label>
     <ListPrice>
        <Amount>895</Amount>
      <CurrencyCode>USD</CurrencyCode>
      <FormattedPrice>$8.95</FormattedPrice>
     </ListPrice>
      <Manufacturer>Houghton Mifflin Books for Children</Manufacturer>
    <NumberOfItems>1</NumberOfItems>
    <NumberOfPages>204</NumberOfPages>
    <ProductGroup>eBooks</ProductGroup>
    <PublicationDate>1993-04-26</PublicationDate>
    <Publisher>Houghton Mifflin Books for Children</Publisher>
    <ReadingLevel>Young Adult</ReadingLevel>
    <ReleaseDate>1993-04-26</ReleaseDate>
    <Studio>Houghton Mifflin Books for Children</Studio>
    <Title>The Giver (Newbery Medal Book)</Title>
  **</ItemAttributes>**
  </Item>
  <Item>  another item list2</Item>
  <Item>  another item list<3.../Item>
 </Items>
  </ItemSearchResponse>

Here, I want to show all the title values and formatted price of all books in grid view.

I tried so far.,

        XmlDocument xdoc = new XmlDocument();
        xdoc.Load(response.GetResponseStream());
        XmlNamespaceManager ns = new XmlNamespaceManager(xdoc.NameTable);
        ns.AddNamespace("ms", "http://webservices.amazon.com/AWSECommerceService/2005-10-05");

        XmlNodeList xnl = xdoc.SelectNodes("//ms:Title", ns);
        XmlNodeList xnl1 = xdoc.SelectNodes("//ms:FormattedPrice", ns);



        DataTable dt=new DataTable();
        dt.Columns.Add("Title",typeof(string));
        dt.Columns.Add("Price", typeof(string));

        foreach (XmlNode Title in xnl)
        {
            DataRow dr = dt.NewRow();
            dr["Title"] = Title.InnerText;

            dt.Rows.Add(dr);
        }
        GridView1.DataSource = dt;
        GridView1.DataBind();

How to show Price and Title value in grid view ? ( The Respone having a lot nodes like title , Price, isbn and goes on.Please let me know, if you need more information.

Thanks.

  • 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-11T02:53:34+00:00Added an answer on June 11, 2026 at 2:53 am

    LINQ to XML that parse the XML doc.

    XNamespace ns = "http://webservices.amazon.com/AWSECommerceService/2005-10-05";
    XDocument doc=XDocument.Load(response.GetResponseStream());
    
    var result= doc.Descendants(ns + "ItemAttributes").Select( p=> new 
     {
     Title=p.Element(ns+ "Title").Value,
     Price = p.Element(ns +"ListPrice").Element(ns+"FormattedPrice").Value
    }).ToList();
    GridView1.DataSource = result;
    GridView1.DataBind();
    

    Or change XPath expression,

     XmlNodeList xnl = xdoc.SelectNodes("/ms:ItemSearchRespone/ms:Items/ms:Item/ms:ItemAttributes", ns);
    
      foreach (XmlNode ele in xnl)
       {
         Console.WriteLine(ele.SelectSingleNode("ms:Title", ns).InnerText);
         Console.WriteLine(ele.SelectSingleNode("ms:ListPrice/ms:FormattedPrice", ns).InnerText);
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using AWS. I got an AMI which had apache, tomcat, mysql stack.
Has anyone benchmarked the effect of using AWS/Cloudfront as a CDN on response times?
So I will be using AWS for a future project, and I have been
I'm using AWS Beanstalk which allows me to set environment properties in the backend
I am using AWS CloudFormation for my application and am trying to make a
I am using marcel's aws-s3 gem. I'm trying to require it in my project:
I'm using : log_file = AWS::S3::Bucket.logs_for('downloads.idance.net').first I would then like to delete each file
I'm using the following command to set up the AWS launch config: as-create-launch-config test1autoscale
I'm trying to set some custom AWS CloudWatch metrics using the Java SDK. I
How do i start and stop an amazon EC2 instance programmatically using aws-sdk in

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.