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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:40:13+00:00 2026-05-14T04:40:13+00:00

I’m trying to create a RSS 2.0 feed in ASP.NET C# with products to

  • 0

I’m trying to create a RSS 2.0 feed in ASP.NET C# with products to provide to Froogle.

The RSS feed should look like:

http://www.google.com/support/merchants/bin/answer.py?answer=160589&hl=en

I’m using the SyndicationFeed and SyndicationsItems to create the feed. But I’m having trouble adding the extra elements like g:image_link.

I try the extra elements like;

syndicationItem.ElementExtensions.Add(new XElement("image_link", product.ImageLink).CreateReader());

This works, but how can I add the namespace

xmlns:g=”http://base.google.com/ns/1.0″

to the first RSS tag and use this for the extension elements?

Thank you

  • 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-14T04:40:13+00:00Added an answer on May 14, 2026 at 4:40 am

    I just wrote something like this last week, as a matter of fact. I didn’t have much time, so it’s not optimized or pretty.

    I used an XDocument, though.

    static XDocument GetXDocument(List<GoogleProduct> googleProducts)
    {
        XNamespace gns = "http://base.google.com/ns/1.0";
    
        XDocument document = new XDocument(
            new XElement("rss",
                new XAttribute("version", "2.0"),
                new XAttribute(XNamespace.Xmlns + "g", gns),
                new XElement("channel",
                    new XElement("title", "X Company Feed"),
                    new XElement("description", "X Description"),
                    new XElement("link", "http://www.somecompany.com/"),
                    from googleProduct in googleProducts
                    select new XElement("item",
                        new XElement("title", googleProduct.Title),
                        new XElement(gns + "brand", googleProduct.ProductRecommendedAttributes.Brand),
                        new XElement(gns + "manufacturer", googleProduct.ProductRecommendedAttributes.Manufacturer),
                        new XElement(gns + "condition", googleProduct.Condition),
                        new XElement("description", googleProduct.Description),
                        new XElement(gns + "id", googleProduct.ID),
                        from img in googleProduct.ProductRecommendedAttributes.ImageLinks
                        select new XElement(gns + "image_link", img),
                        new XElement("link", googleProduct.Link),
                        new XElement(gns + "price", googleProduct.Price.ToString("0.00")),
                        new XElement(gns + "product_type", googleProduct.ProductRecommendedAttributes.ProductType),
                        from pmt in googleProduct.ProductOptionalAttributes.PaymentAccepteds
                        select new XElement(gns + "payment_accepted", pmt)))));
    
        //
        return document;
    }
    

    (FYI: GoogleProduct is just a temporary mapper class I used)

    It will generate a document along these lines

    <?xml version="1.0" encoding="utf-8"?>
    <rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">
      <channel>
        <title>Blah Data Feed</title>
        <description>Stuff from Blah</description>
        <link>http://www.blah.com/shopping</link>
        <item>
          <title>Blah</title>
          <g:brand>Blah</g:brand>
          <g:manufacturer>Blah</g:manufacturer>
          <g:condition>New</g:condition>
          <description>blah blah</description>
          <g:id>268</g:id>
          <g:image_link>http://www.blah.com/shopping/images/PRODUCT/medium/268.jpg</g:image_link>
          <link>http://www.blah.com/</link>
          <g:price>1747.00</g:price>
          <g:product_type>Blah Blah</g:product_type>
          <g:payment_accepted>Cash</g:payment_accepted>
          <g:payment_accepted>Check</g:payment_accepted>
          <g:payment_accepted>Visa</g:payment_accepted>
          <g:payment_accepted>Mastercard</g:payment_accepted>
        </item>
        <item>
          <title>Blah</title>
          <g:brand>Blah</g:brand>
          <g:manufacturer>Blah</g:manufacturer>
          <g:condition>New</g:condition>
          <description>blah blah</description>
          <g:id>269</g:id>
          <g:image_link>http://www.blah.com/shopping/images/PRODUCT/medium/269.jpg</g:image_link>
          <link>http://www.blah.com/</link>
          <g:price>1103.00</g:price>
          <g:product_type>blah blah</g:product_type>
          <g:payment_accepted>Cash</g:payment_accepted>
          <g:payment_accepted>Check</g:payment_accepted>
          <g:payment_accepted>Visa</g:payment_accepted>
          <g:payment_accepted>Mastercard</g:payment_accepted>
        </item>
      </channel>
    </rss>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text

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.