XML products download failure / corrupted

General ShopSite user discussion

XML products download failure / corrupted

Postby arta!!ack » Thu Jul 22, 2010 2:23 am

Hi.

I have a problem exporting our products via xml for some reason the fields are not exporting correctly.

If I export as a text file then it is ok but as XML it fails.

If you take a look at this code of 1 product when we get down to

<MoreInformationText>

something goes wrong with other fields within the <MoreInformationText> field like add to cart fields, they should not be there.

I cannot solve the problem and have been looking at it for some time.

It is not just this one product but some products are OK.

I am using version 10.1

Arthur.

Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE ShopSiteProducts PUBLIC "-//shopsite.com//ShopSiteProduct DTD//EN" "http://www.shopsite.com/XML/1.9/shopsiteproducts.dtd">
<ShopSiteProducts>
<Response>
<ResponseCode>1</ResponseCode>
<ResponseDescription>success</ResponseDescription>
</Response>
<Products>
<Product>
<Name>BRIO BELL RATTLE GREEN</Name>
<SKU>BRIO30054G</SKU>
<ProductID>218</ProductID>
<Price>3.99</Price>
<SaleAmount/>
<Taxable>checked</Taxable>
<AvaTaxCode/>
<VAT>0</VAT>
<Weight>0.00</Weight>
<QuantityOnHand>4</QuantityOnHand>
<LowStockThreshold>2</LowStockThreshold>
<OutOfStockLimit>0</OutOfStockLimit>
<GroundShipping>0.00</GroundShipping>
<SecondDayShipping>0.00</SecondDayShipping>
<NextDayShipping>0.00</NextDayShipping>
<Shipping3>0.00</Shipping3>
<Shipping4>0.00</Shipping4>
<Shipping5>0.00</Shipping5>
<Shipping6>0.00</Shipping6>
<Shipping7>0.00</Shipping7>
<Shipping8>0.00</Shipping8>
<Shipping9>0.00</Shipping9>
<Graphic>BRIO/PRE_SCHOOL/BRIO_30054G_bell_rattle_green_600a.jpg</Graphic>
<ProductImageSize>2</ProductImageSize>
<SearchKeywords>brio, bell, rattle, green, educational, toy</SearchKeywords>
<SearchMakePage/>
<ProductDescription/>
<OptionText/>
<OptionMenus/>
<CustomerTextEntryBox/>
<CustomerTextEntryHeader/>
<CustomerTextEntryColumns>40</CustomerTextEntryColumns>
<CustomerTextEntryRows>4</CustomerTextEntryRows>
<CrossSell/>
<ProductOnPages>
<Name>ALL OUR PRODUCTS</Name>
<Name>BRIO_PRE_SCHOOL</Name>
</ProductOnPages>
<AddToPages/>
<DisplayMoreInformationPage_>checked</DisplayMoreInformationPage_>
<MoreInformationText>&lt;
&rsquo;3
&quot;copy-of-gradient1-product.sst
checked&quot;

&gt;checked
&lt;checked
checked&quot;
Bold
&quot;Normal
&gt;Bold
Normal&rsquo;
Plain
&lt;Small
Plain&gt;
Normal
&lt;Center
Off&quot;
Add To Cart
&quot;View Cart
&gt;Tangible

&nbsp;
1
&lt;[shopsite-images]/buttons/sleek/sleek-add.gif
1&gt;
[shopsite-images]/buttons/sleek/sleek-viewcart.gif
&lt;none
selected&quot;
Store
&quot;1
&gt;


&nbsp;

&lt;0.00

&gt;0
&lt;
none
&gt;4

&nbsp;

#BC801D
&nbsp;#BC801D
#FFFF23
</MoreInformationText>
<MoreInformationGraphic>
</MoreInformationGraphic>
<MoreInfoImageSize>0.00</MoreInfoImageSize>
<MoreInfoTitle/>
</MoreInfoTitle>
<MoreInfoMetaKeywords/>
</MoreInfoMetaKeywords>
<MoreInfoMetaDescription/>
</MoreInfoMetaDescription>
<FileName>about_the_brio_bell_rattle_green.html</FileName>
<ProductSitemap/>
</ProductSitemap>
<ProductSitemapPriority/>
</ProductSitemapPriority>
<ProductCrossSell>Brio</ProductCrossSell>
<GlobalCrossSell>educational pre school toy</GlobalCrossSell>
<MoreInfoImage1>New</MoreInfoImage1>
<MoreInfoImage2/>
</MoreInfoImage2>
<MoreInfoImage3/>
</MoreInfoImage3>
<MoreInfoImage4>0</MoreInfoImage4>
<MoreInfoImage5/>&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
.style1 {
 font-size: 18px
}
--&gt;
&lt;/style&gt;
&lt;a href=&quot;javascript:history.go(-1);&quot; class=&quot;style1&quot;&gt;Previous Page&lt;/a&gt;</MoreInfoImage5>
<MoreInfoImage6>RM1</MoreInfoImage6>
<MoreInfoImage7>2.20</MoreInfoImage7>
<MoreInfoImage8>BRIO PRE SCHOOL</MoreInfoImage8>
<MoreInfoImage9/>
</MoreInfoImage9>
<MoreInfoImage10>none</MoreInfoImage10>
<MoreInfoImage11>none</MoreInfoImage11>
<MoreInfoImage12>none</MoreInfoImage12>
<MoreInfoImage13>none</MoreInfoImage13>
<MoreInfoImage14>none</MoreInfoImage14>
<MoreInfoImage15>none</MoreInfoImage15>
<MoreInfoImage16>none</MoreInfoImage16>
<MoreInfoImage17>none</MoreInfoImage17>
<MoreInfoImage18>none</MoreInfoImage18>
<MoreInfoImage19>none</MoreInfoImage19>
<MoreInfoImage20>none</MoreInfoImage20>
<MoreInfoImageExtraSize>3</MoreInfoImageExtraSize>
<Template>copy-of-gradient1-product.sst</Template>
<DisplayName_>checked</DisplayName_>
<DisplaySKU_>
<DisplayPrice_>checked</DisplayPrice_>
<DisplayGraphic_>checked</DisplayGraphic_>
<SaleOn>checked</SaleOn>
<NameStyle>Bold</NameStyle>
<NameSize>Normal</NameSize>
<PriceStyle>Bold</PriceStyle>
<PriceSize>Normal</PriceSize>
<SKUStyle>Plain</SKUStyle>
<SKUSize>Small</SKUSize>
<DescriptionStyle>Plain</DescriptionStyle>
<DescriptionSize>Normal</DescriptionSize>
<ImageAlignment>Center</ImageAlignment>
<TextWrap>Off</TextWrap>
<AddtoCartButton>Add To Cart</AddtoCartButton>
<ViewCartButton>View Cart</ViewCartButton>
<ProductType>Tangible</ProductType>
<DisplayOrderQuantity_>
<DisplayOrderingOptions_>
<UseAddtoCartImage_>1</UseAddtoCartImage_>
<AddtoCartImage>[shopsite-images]/buttons/sleek/sleek-add.gif</AddtoCartImage>
<UseViewCartImage_>1</UseViewCartImage_>
<ViewCartImage>[shopsite-images]/buttons/sleek/sleek-viewcart.gif</ViewCartImage>
<ProductDownloadLocation>none</ProductDownloadLocation>
<SearchDestType>selected</SearchDestType>
<SearchDest>Store</SearchDest>
<DimensionOptions>1</DimensionOptions>
<DimensionText>
<DimensionSelected>
<FedExContainer>
<USPSContainer>
<NoShippingCharges>
<ExtraHandlingCharge>0.00</ExtraHandlingCharge>
<QBImport>
<MinimumQuantity>0</MinimumQuantity>
<QuantityPricing>
<Enabled></Enabled>
<NumberPriceBreaks>4</NumberPriceBreaks>
<Comment></Comment>
<BackgroundColors>
<QuantityColor>#BC801D</QuantityColor>
<PriceAndCommentColor>#BC801D</PriceAndCommentColor>
<OnSaleColor>#FFFF23</OnSaleColor>
</BackgroundColors>
<PriceBreaks>
<PriceBreak>
<StartingQuantity>1</StartingQuantity>
<UnitPrice>0.00</UnitPrice>
</PriceBreak>
<PriceBreak>
<StartingQuantity>
<UnitPrice>
</PriceBreak>
<PriceBreak>
<StartingQuantity>
<UnitPrice>
</PriceBreak>
<PriceBreak>
<StartingQuantity>
<UnitPrice>
</PriceBreak>
</PriceBreaks>
</QuantityPricing>
<QuantityPricingGroup>
<DisplayQuantityPricing>checked</DisplayQuantityPricing>
<VariablePrice_>
<VariableName_>
<VariableSKU_>
<GoogleBase>checked</GoogleBase>
<Brand>Brio</Brand>
<GoogleProductType>educational pre school toy</GoogleProductType>
<GoogleCondition>New</GoogleCondition>
<DobaItemID>
<SubscriptionProduct>
<SubPaymentIntervalUnit>monthly</SubPaymentIntervalUnit>
<SubRegularPaymentAmount>
<SubEndingPeriod>9999</SubEndingPeriod>
<SubBillOn>0</SubBillOn>
<SubTrialCheckBox>
<SubTrialPaymentAmount>
<SubTrialPeriods>
<SubOneTimeCheckBox>
<SubOneTimePaymentAmount>
<Subproducts>
<ProductField1>&lt;style type&quot;text/css&quot;&gt;
&lt;!--
.style1 {
 font-size: 18px
}
--&gt;
&lt;/style&gt;
&lt;a href=&quot;javascript:history.go(-1);&quot; class=&quot;style1&quot;&gt;Previous Page&lt;/a&gt;=</ProductField1>
<ProductField2>RM1</ProductField2>
<ProductField3>2.20</ProductField3>
<ProductField4>BRIO PRE SCHOOL</ProductField4>
<ProductField5>
<ProductField6>
<ProductField7>
<ProductField8>
<ProductField9>
<ProductField10>
<ProductField11>
<ProductField12>
<ProductField13>
<ProductField14>
<ProductField15>
<ProductField16>
<ProductField17>
<ProductField18>
<ProductField19>
<ProductField20>
<ProductField21>
<ProductField22>
<ProductField23>
<ProductField24>
<ProductField25>
</Product>
</Products>
</ShopSiteProducts>
arta!!ack
 
Posts: 47
Joined: Wed Jun 13, 2007 2:23 am
Location: Lancashire UK

Postby jnarayan » Fri Jul 23, 2010 6:11 am

> If I export as a text file then it is ok but as XML it fails.

I assume you mean your XML parsing step fails with this downloaded file.

We ran into the same issue and here is why. All those special chars that you see in the <MoreInformationText> tag (for exampe, &lt; &rsquo;3 &quot;copy-of-gradient1-product.sst checked&quot; ) are all mostly HTML markup. And according to the XML specification, if such HTML markup is going to be included as the value of any tag, then that markup needs to be wrapped using the CDATA tag. http://en.wikipedia.org/wiki/CDATA. So, this looks like a bug in the XML export function of Shopsite.

We have overcome this problem in the short term by substituting all those special chars before feeding it to the XML parser library. You may try the same. I think the right fix is for Shopsite to include then in a CDATA tag.

Send me an email if you want to know more details.
Jagath Narayan
Ordoro : Web based order management for Shopsite merchants
www.ordoro.com
jnarayan
 
Posts: 13
Joined: Fri Jul 23, 2010 5:53 am
Location: Austin, TX

Postby loren_d_c » Fri Jul 23, 2010 1:02 pm

Non-escaped HTML mark-up inside XML should be enclosed in CDATA tags, however if the reserved characters such as <, >, &, and other high-ascii characters are escaped with the proper HTML entity, then it doesn't need to be enclosed in CDATA. And even if enclosed in CDATA, the high-ascii characters would still have to be escaped.

I copied this code into a notepad doc and saved it with a .xml extension, and when I opened it in a browser (IE and Firefox both have XML parsers) it got past the More Info Text just fine, it barfed on some mismatched tags later. In fact, there are a lot of missing tags and extra tags, and I am guessing what was pasted does not represent the raw XML exactly as is was downloaded from ShopSite. In fact, I downloaded the products from my test store (v10 sp1 r2, in this particular case) in XML format and that XML opened just fine in IE and Firefox, it didn't have any of the problems in this example.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby arta!!ack » Mon Jul 26, 2010 12:19 am

Hi Loren.

Works for me fine also when opened in I.E.

I was having a problem importing the file into Shopsite, so I thought I would take a look at the file and see what was the problem.

I opened it up in Dreamweaver so I suspect then that could be the issue, but not one have have had before using Dreamweaver and XML.

Arthur.
arta!!ack
 
Posts: 47
Joined: Wed Jun 13, 2007 2:23 am
Location: Lancashire UK


Return to User Forum

Who is online

Users browsing this forum: Google [Bot] and 29 guests