How to Make dbupload.cgi update pages Text1, 2, 3 fields?

General ShopSite user discussion

How to Make dbupload.cgi update pages Text1, 2, 3 fields?

Postby kelsey@richmondrc.com » Tue Mar 03, 2009 2:43 pm

Question 20090303_1329:

How to Make dbupload.cgi update the Text1, Text2 and Text3 Field using tagged data in pages xml file.

Background:
We are uploading pages and products xml files and using dbupload.cgi and generate.cgi to publish the ShopSite store. This is working well in an automated manner.

Have now included content for pages fields Text1, Text2 and Text3 into our source XML file. Typical example of the tagged text in the XML file prior to upload looks like this:

<Text1>GREAT FOR WORKING WITH GLUES OF ALL TYPES</Text1>
However, after uploading the XML and then firing dbupload.cgi and generate.cgi all data except the Text1, Text2 and Text3 is updated on the appropriate pages but not the Text1, Text2 or Text3 data itself.

Workarounds attempted:
Have used the ShopSite hand edit facility on one page for force test values for Text1, Text2 and Text3 onto one page. Checked the store results and they display as expected on the page anticipated.

Then exported the pages XML and searched for and confirmed that the test fields do "stick" and export OK back to us. The snippet of XML backfed to us in the download looks like this:
<Text1>Test Text 1</Text1>

<Text2>Test Text 2</Text2>

<Text3>Test Text 3</Text3>

Further information:
Suspected the Pages Template but hand forced data does display OK via the SS template and does download OK back to us in XML looking as expected.

Is it possible that the names of the uploaded XML tages is expected by dbupload.cgi to be different than Text1, Text2 and Text3? There are some other odd name variations on Tags uploaded and downloaded between V10 and earlier.

Other ideas?

ShopSite® Pro 10 r6.1
kelsey@richmondrc.com
 
Posts: 21
Joined: Sat Dec 13, 2008 11:37 am
Location: Delta, BC

Postby loren_d_c » Wed Mar 04, 2009 12:29 pm

Does the same thing occur if you upload the same pages XML file manually via the Utilities -> Database -> Upload menu?

I didn't have the same problem. I downloaded my pages in XML format, edited the file via notepad and found a page that had nothing in text 1, text 2, or text 3 (<Text1/><Text2/><Text3/>), added some text to text 1 and text 3, re-uploaded the XML via Utilities -> Database -> Upload, and those fields in the pages were updated. I then edited the same file, modified the text in text 1 and text 3, and added text to text 2, re-uploaded it via Utilities -> Database -> Upload, and again all of those fields in that page record were updated to contain the data I specified in the XML file.

v10 r7.1

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

Resolution

Postby kelsey@richmondrc.com » Wed Mar 04, 2009 2:33 pm

Answer/Resolution:

The feedback report coming from ShopSite after running dbupload.cgi was stating the following:

"XML document is not recognized or is not well-formed", and

"Upload aborted"

The ShopSite description of fields Text1, Text2, Text3 makes mention of avoiding ' and " in the text strings. We were trapping these but given the feedback report we suspected other characters may also be verboten. But which?

We then examined the XML file that we were producing that dbupload.cgi was trying to process and failing. Used a couple of different XML editors. Some of these editors opened the file without trouble. However one in particular (XML Notepad 2007 from Microsoft) reported that it could not open the file due to "whitespace" and provided a pointer to the line and column of concern. Turned out it was an & used instead of the word "and". Purged all of these from the source text. Tried again. Found that some editors also did not like < or > unless they were part of a tag. Subsequently changed code for input system on source side to caution against use of any of ' " < > &.

Then regenerated the XML file, checked it out using a few editors. All happy. Uploaded to ShopSite and ran dbupload.cgi and presto, it worked as expected.

Bottom line here is that XML is fussy and not as tightly standardized in application as it might be. Some editors report errors where others don't. ShopSite parser likely has it's own peculiarities that are not all documented. Stay away from ' " and & in the text string. We are also avoiding < and > just in case.
kelsey@richmondrc.com
 
Posts: 21
Joined: Sat Dec 13, 2008 11:37 am
Location: Delta, BC

Postby loren_d_c » Wed Mar 04, 2009 4:49 pm

For XML to be valid, it should not have a raw &, <, >, or any high ASCII characters in the data. This is not specific to ShopSite (although you may find some 'loose' XML parsers that don't properly adhere to correct XML standards that don't complain about them). I've found Firefox to have a pretty good XML parser when it comes to enforcing the XML standard.

You can escape &, <, and > to their HTML entity equivalents (&amp;, &lt;, and &gt; respectively) and that should be acceptable. Also, you can enclose the data in an XML CDATA envelope and you can then include all of the &, <, and > characters you want.

High ASCII characters (characters higher than 129 in the character table) probably have to be escaped to their number-based entity reference whether or not they are in a CDATA envelope. For example, the Japanese Yen symbol should be changed to '&# 165;' (minus the space, I just had to put that there to keep the forum from rendering the actual symbol).

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

THis is related.

Postby RedSyntax » Mon Mar 09, 2009 10:26 am

This seems very much related to an issue I am having with shopsites XML and special chracters.
RedSyntax
 
Posts: 51
Joined: Mon Nov 17, 2008 7:29 am


Return to User Forum

Who is online

Users browsing this forum: No registered users and 114 guests