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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:34:57+00:00 2026-05-28T03:34:57+00:00

I run an affiliate website, and I have code that consumes the XML datafeeds.

  • 0

I run an affiliate website, and I have code that consumes the XML datafeeds. I have written a method that can scrape and store the data from the XML feed, it works perfectly for say 60 feeds we have. Each row in the feed is created as a @product.

Now enter Linkshare, the code I have that works for the other 60 feeds doesn’t work for Linkshare feeds. Instead of having @products.count = a few hundred, it tries to load ALL products into ONE instance of @products, so I get:

Soul Cal Deluxe Heart Camisole Top – WomensOnly Vest Top – WomensSoul
Cal Deluxe Racer Back Vest Top – WomensSoul Cal Deluxe Racer Back Vest
Top – WomensSoul Cal Deluxe Racer Back Vest Top – WomensSoul Cal
Deluxe Racer Back Vest Top – WomensCrafted Grunge Jumper – WomensMiso
Pearl & Fireball Ring Stack – WomensSoul Cal Deluxe Checked Shacket –
MensSoul Cal Deluxe Hines Stripe Shirt – MensMiso Embellished Waist
Dress – WomensGlamorous Belted Dress – WomensMiso Front Tie Shorts –
WomensMiso Tie Front Shorts – WomensSoul Cal Deluxe Stretch Skinny
Trousers – WomensSoul Cal Deluxe Stretch Skinny Trousers – WomensSoul
Cal Deluxe Stretch Skinny Trousers – WomensVero Moda Bernice Dress –
WomensMiso Dipped Hem Maxi Dress – WomensSoul Cal Deluxe Belted Chinos
– WomensSoul Cal Deluxe Stretch Skinny Trousers – WomensMiso Jewel Bodycon Dress – WomensMiso Evening Bandeau Dress – WomensMiso Aztec
Tube Skirt – WomensCrafted Embellished Neck Dress – WomensMiso Spot
Dress – WomensMiso Spot Dress – Womens”}]

(Note, I took just the end of the console log, but you see what I mean.

I’ve run lots of testing, this has been a problem we’ve had for a while.

Has anyone had anything like this?

Could it be doctypes or hpricot?

Any Suggestions?

Example feed:

<?xml version="1.0" encoding="UTF-8"?><merchandiser xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="merchandiser.xsd">
<header><merchantId>36503</merchantId><merchantName>Republic</merchantName><createdOn>2012-01-12/20:21:17</createdOn></header><product product_id="73794" name="Soul Cal Deluxe Borg DLX Zip Through Hoody - Mens" sku_number="73794" manufacturer_name="Soul Cal Deluxe" part_number="73794"><category><primary>Men &gt; Sweats &amp; Hoodies</primary><secondary></secondary></category><URL><product>http://click.linksynergy.com/link?id=g*0hRDNOv4M&amp;offerid=215450.73794&amp;type=15&amp;murl=http%3A%2F%2Fwww.republic.co.uk%2Finvt%2F73794</product><productImage>http://www.republic.co.uk/content/ebiz/republic/invt/73794/73794_lg1.jpg</productImage><buy></buy></URL><description><short>Blue, Hoodies, Hand wash only</short><long></long></description><discount currency="GBP"><amount></amount><type>amount</type></discount><price currency="GBP"><sale begin_date="" end_date="">34.99</sale><retail>34.99</retail></price><brand>Soul Cal Deluxe</brand><shipping><cost currency="GBP"><amount>3.95</amount><currency>GBP</currency></cost><information></information><availability></availability></shipping><keywords></keywords><upc></upc><m1></m1><pixel>http://ad.linksynergy.com/fs-bin/show?id=g*0hRDNOv4M&amp;bids=215450.73794&amp;type=15&amp;subid=0</pixel></product>
<product product_id="51118" name="Jack &amp; Jones Dale Jack Jeans - Mens" sku_number="51118" manufacturer_name="Jack&amp;Jones" part_number="51118"><category><primary>Men &gt; Jeans</primary><secondary></secondary></category><URL><product>http://click.linksynergy.com/link?id=g*0hRDNOv4M&amp;offerid=215450.51118&amp;type=15&amp;murl=http%3A%2F%2Fwww.republic.co.uk%2Finvt%2F51118</product><productImage>http://www.republic.co.uk/content/ebiz/republic/invt/51118/51118_lg1.jpg</productImage><buy></buy></URL><description><short>Blue, Straight</short><long></long></description><discount currency="GBP"><amount></amount><type>amount</type></discount><price currency="GBP"><sale begin_date="" end_date="">40.00</sale><retail>64.99</retail></price><brand>Jack&amp;Jones</brand><shipping><cost currency="GBP"><amount>3.95</amount><currency>GBP</currency></cost><information></information><availability></availability></shipping><keywords></keywords><upc></upc><m1></m1><pixel>http://ad.linksynergy.com/fs-bin/show?id=g*0hRDNOv4M&amp;bids=215450.51118&amp;type=15&amp;subid=0</pixel></product>
<product product_id="51128" name="Diesel Straight Leg Larkee Jeans - Mens" sku_number="51128" manufacturer_name="Diesel" part_number="51128"><category><primary>Men &gt; Jeans</primary><secondary></secondary></category><URL><product>http://click.linksynergy.com/link?id=g*0hRDNOv4M&amp;offerid=215450.51128&amp;type=15&amp;murl=http%3A%2F%2Fwww.republic.co.uk%2Finvt%2F51128</product><productImage>http://www.republic.co.uk/content/ebiz/republic/invt/51128/51128_lg1.jpg</productImage><buy></buy></URL><description><short>Blue, Straight</short><long></long></description><discount currency="GBP"><amount></amount><type>amount</type></discount><price currency="GBP"><sale begin_date="" end_date="">120.00</sale><retail>120.00</retail></price><brand>Diesel</brand><shipping><cost currency="GBP"><amount>0.00</amount><currency>GBP</currency></cost><information></information><availability></availability></shipping><keywords></keywords><upc></upc><m1></m1><pixel>http://ad.linksynergy.com/fs-bin/show?id=g*0hRDNOv4M&amp;bids=215450.51128&amp;type=15&amp;subid=0</pixel></product>
<product product_id="68226" name="Miso Fox Scarf - Womens" sku_number="68226" manufacturer_name="Miso" part_number="68226"><category><primary>Women &gt; Accessories</primary><secondary></secondary></category><URL><product>http://click.linksynergy.com/link?id=g*0hRDNOv4M&amp;offerid=215450.68226&amp;type=15&amp;murl=http%3A%2F%2Fwww.republic.co.uk%2Finvt%2F68226</product><productImage>http://www.republic.co.uk/content/ebiz/republic/invt/68226/68226_lg1.jpg</productImage><buy></buy></URL><description><short>Stone, Scarves, Machine washable</short><long></long></description><discount currency="GBP"><amount></amount><type>amount</type></discount><price currency="GBP"><sale begin_date="" end_date="">5.00</sale><retail>19.99</retail></price><brand>Miso</brand><shipping><cost currency="GBP"><amount>3.95</amount><currency>GBP</currency></cost><information></information><availability></availability></shipping><keywords></keywords><upc></upc><m1></m1><pixel>http://ad.linksynergy.com/fs-bin/show?id=g*0hRDNOv4M&amp;bids=215450.68226&amp;type=15&amp;subid=0</pixel></product>
<product product_id="67968" name="Levis Pleat Trucker Jacket - Womens" sku_number="67968" manufacturer_name="Levis" part_number="67968"><category><primary>Women &gt; Coats &amp; Jackets</primary><secondary></secondary></category><URL><product>http://click.linksynergy.com/link?id=g*0hRDNOv4M&amp;offerid=215450.67968&amp;type=15&amp;murl=http%3A%2F%2Fwww.republic.co.uk%2Finvt%2F67968</product><productImage>http://www.republic.co.uk/content/ebiz/republic/invt/67968/67968_lg1.jpg</productImage><buy></buy></URL><description><short>Blue, Jackets</short><long></long></description><discount currency="GBP"><amount></amount><type>amount</type></discount><price currency="GBP"><sale begin_date="" end_date="">30.00</sale><retail>84.99</retail></price><brand>Levis</brand><shipping><cost currency="GBP"><amount>3.95</amount><currency>GBP</currency></cost><information></information><availability></availability></shipping><keywords></keywords><upc></upc><m1></m1><pixel>http://ad.linksynergy.com/fs-bin/show?id=g*0hRDNOv4M&amp;bids=215450.67968&amp;type=15&amp;subid=0</pixel></product>
<product product_id="81217" name="G-Star Dean Army Tapered Jeans - Womens" sku_number="81217" manufacturer_name="G-Star" part_number="81217"><category><primary>Women &gt; Jeans</primary><secondary></secondary></category><URL><product>http://click.linksynergy.com/link?id=g*0hRDNOv4M&amp;offerid=215450.81217&amp;type=15&amp;murl=http%3A%2F%2Fwww.republic.co.uk%2Finvt%2F81217</product><productImage>http://www.republic.co.uk/content/ebiz/republic/invt/81217/81217_lg1.jpg</productImage><buy></buy></URL><description><short>Black, Straight</short><long></long></description><discount currency="GBP"><amount></amount><type>amount</type></discount><price currency="GBP"><sale begin_date="" end_date="">115.00</sale><retail>115.00</retail></price><brand>G-Star</brand><shipping><cost currency="GBP"><amount>0.00</amount><currency>GBP</currency></cost><information></information><availability></availability></shipping><keywords></keywords><upc></upc><m1></m1><pixel>http://ad.linksynergy.com/fs-bin/show?id=g*0hRDNOv4M&amp;bids=215450.81217&amp;type=15&amp;subid=0</pixel></product>
<product product_id="58377" name="Police 883 Embro Hat - Mens" sku_number="58377" manufacturer_name="Police 883" part_number="58377"><category><primary>Men &gt; Accessories</primary><secondary></secondary></category><URL><product>http://click.linksynergy.com/link?id=g*0hRDNOv4M&amp;offerid=215450.58377&amp;type=15&amp;murl=http%3A%2F%2Fwww.republic.co.uk%2Finvt%2F58377</product><productImage>http://www.republic.co.uk/content/ebiz/republic/invt/58377/58377_lg1.jpg</productImage><buy></buy></URL><description><short>Black, Hats &amp; Beanies</short><long></long></description><discount currency="GBP"><amount></amount><type>amount</type></discount><price currency="GBP"><sale begin_date="" end_date="">17.99</sale><retail>17.99</retail></price><brand>Police 883</brand><shipping><cost currency="GBP"><amount>3.95</amount><currency>GBP</currency></cost><information></information><availability></availability></shipping><keywords></keywords><upc></upc><m1></m1><pixel>http://ad.linksynergy.com/fs-bin/show?id=g*0hRDNOv4M&amp;bids=215450.58377&amp;type=15&amp;subid=0</pixel></product>
<product product_id="58306" name="Diesel Kyle Beanie - Mens" sku_number="58306" manufacturer_name="Diesel" part_number="58306"><category><primary>Men &gt; Accessories</primary><secondary></secondary></category><URL><product>http://click.linksynergy.com/link?id=g*0hRDNOv4M&amp;offerid=215450.58306&amp;type=15&amp;murl=http%3A%2F%2Fwww.republic.co.uk%2Finvt%2F58306</product><productImage>http://www.republic.co.uk/content/ebiz/republic/invt/58306/58306_lg1.jpg</productImage><buy></buy></URL><description><short>Black, Hats &amp; Beanies</short><long></long></description><discount currency="GBP"><amount></amount><type>amount</type></discount><price currency="GBP"><sale begin_date="" end_date="">19.99</sale><retail>19.99</retail></price><brand>Diesel</brand><shipping><cost currency="GBP"><amount>3.95</amount><currency>GBP</currency></cost><information></information><availability></availability></shipping><keywords></keywords><upc></upc><m1></m1><pixel>http://ad.linksynergy.com/fs-bin/show?id=g*0hRDNOv4M&amp;bids=215450.58306&amp;type=15&amp;subid=0</pixel></product>
<product product_id="86865" name="Miso Fair Isle Cardigan - Womens" sku_number="86865" manufacturer_name="Miso" part_number="86865"><category><primary>Women &gt; Knitwear</primary><secondary></secondary></category><URL><product>http://click.linksynergy.com/link?id=g*0hRDNOv4M&amp;offerid=215450.86865&amp;type=15&amp;murl=http%3A%2F%2Fwww.republic.co.uk%2Finvt%2F86865</product><productImage>http://www.republic.co.uk/content/ebiz/republic/invt/86865/86865_lg1.jpg</productImage><buy></buy></URL><description><short>Stone, Cardigans, Hand wash only</short><long></long></description><discount currency="GBP"><amount></amount><type>amount</type></discount><price currency="GBP"><sale begin_date="" end_date="">49.99</sale><retail>49.99</retail></price><brand>Miso</brand><shipping><cost currency="GBP"><amount>3.95</amount><currency>GBP</currency></cost><information></information><availability></availability></shipping><keywords></keywords><upc></upc><m1></m1><pixel>http://ad.linksynergy.com/fs-bin/show?id=g*0hRDNOv4M&amp;bids=215450.86865&amp;type=15&amp;subid=0</pixel></product>
<product product_id="52947" name="White Label Chinos - Mens" sku_number="52947" manufacturer_name="White Label" part_number="52947"><category><primary>Men &gt; trs</primary><secondary></secondary></category><URL><product>http://click.linksynergy.com/link?id=g*0hRDNOv4M&amp;offerid=215450.52947&amp;type=15&amp;murl=http%3A%2F%2Fwww.republic.co.uk%2Finvt%2F52947</product><productImage>http://www.republic.co.uk/content/ebiz/republic/invt/52947/52947_lg1.jpg</productImage><buy></buy></URL><description><short>Stone, Chinos, Machine washable</short><long></long></description><discount currency="GBP"><amount></amount><type>amount</type></discount><price currency="GBP"><sale begin_date="" end_date="">20.00</sale><retail>20.00</retail></price><brand>White Label</brand><shipping><cost currency="GBP"><amount>3.95</amount><currency>GBP</currency></cost><information></information><availability></availability></shipping><keywords></keywords><upc></upc><m1></m1><pixel>http://ad.linksynergy.com/fs-bin/show?id=g*0hRDNOv4M&amp;bids=215450.52947&amp;type=15&amp;subid=0</pixel></product>
  • 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-28T03:34:58+00:00Added an answer on May 28, 2026 at 3:34 am

    One problem is that the XML is malformed. The <merchandiser> tag is not terminated. Nokogiri will tell you as much if you check the errors method after parsing the document:

    doc.errors
    [
        [0] #<Nokogiri::XML::SyntaxError:0x10109b918
            attr_reader :code = 77,
            attr_reader :column = 1,
            attr_reader :domain = 1,
            attr_reader :file = nil,
            attr_reader :int1 = 1,
            attr_reader :level = 3,
            attr_reader :line = 12,
            attr_reader :str1 = "merchandiser",
            attr_reader :str2 = nil,
            attr_reader :str3 = nil
        >
    ]
    

    Adding a closing </merchandiser> tag at the end of the file cleared that up:

    doc = Nokogiri::XML(File.read('./test.xml'))
    #<Nokogiri::XML::Document:0x1009ae038
        @node_cache = [],
        attr_accessor :errors = [],
        attr_reader :decorators = nil
    >
    

    After fixing that I parsed for product:

    doc.search('product').size
     => 20
    

    There are <product> collisions:

    <product>
      <URL>
        <product />
      </URL>
    </product>
    

    which could confuse your code. It confused my search above that reported 20 occurrences.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I run an XPath in Java with the following xml and code: <?xml version=1.0
I run the code gives me the following sample data md5deep find * |
I run a game and the running is done by hand, I have a
I run an ASP.NET website solution with a few other projects in it. I've
I have a simple web form that feeds into Infusionsoft. Not my call. I
I have run into this problem again and now really need to know how
Run the following Java code: boolean b = false; Double d1 = 0d; Double
I run the following code StringBuilder sb = new StringBuilder(); Stack stack = new
I run an e-commerce website where the following function is defined. I don't control
I run this code using both gpp and microsoft compiler but in both case

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.