Wrangling XML data to CSV

Opinion
Feb 5, 20084 mins

In the last three weeks I’ve discussed my search – nay, quest – for a Web shopping cart that integrates with Quickbooks and my struggle – nay, Herculean battle – with Network Solutions‘ Pro E-Commerce shopping cart service.

A result of my criticisms was that I was contacted by a senior engineer who couldn’t really help. Then, after I wrote last week’s Gearhead, I was contacted by two Network Solutions big-wigs: Shashi Bellamkonda, senior product manager, and Jeff Zimmerman, vice president, E-commerce Products.

We had a good discussion, or perhaps more accurately, I had a good rant. One thing that became clear is that Network Solutions’ lack of documentation is perhaps its biggest problem, with the various deficiencies and bugs I’ve discussed coming in a very, very close second.

That said, among the solutions recommended by my hosting company Intuit, Network Solutions option is still, as far as I can determine, the best. Although that’s a little like saying an SUV with three wheels is better than one with two wheels, but still . . . .

Interestingly, it turns out there is another approach to a major problem I had with the Network Solutions services: how to get order data into the specific comma separated variable (CSV) format a fulfillment company can use.

Until my discussion with the Network Solutions gentlemen, the only export format that appeared to be available for conversion was the e-mail message that is sent to the administrator when an order is accepted.

As I discussed last week, the HTML formatting of these order messages provides some structure for data but not enough to make the translation easy or to ensure that it would be error free. The alternative was the CSV export feature that Network Solutions provides, but this is just a weird, somewhat useless summary of orders.

There is also XML as an alternative export format for orders, but I hadn’t bothered to try it because I assumed it would provide the same data as the CSV export. I was wrong. The XML version actually contains all of the order detail! The gentlemen from Network Solutions admitted that this is, in fact, not documented, but stopped short of admitting it was irrational that there was a difference between the content of the two formats.

So, now that I have a chunk of XML, how am I going to translate it into the CSV format required by the fulfillment house?

Back when I thought I’d have to wrangle the content out of e-mailed orders, I did some research and found an interesting tool called Message Parse that looked promising.

Message Parse ($80) is designed to extract data from messages and export that data to useful formats. You define what delimits each of the fields you’re interested in and Message Parse parses the message content looking sequentially for your fields and assembles the results to create the output.

Great! I tried it and you can do some cool things and it would be perfect for pulling apart the order data except . . . except Message Parse only works on messages that it retrieves from POP3 mailboxes, while I now have a downloaded XML file to work with!

I suppose I could copy the XML content into an e-mail message, send that to an account to be used by Message Parse and have it extract the data, but that would be sort of ridiculous.

I’ve looked at all sorts of XML tools but I’ve yet to find one that can do this job without involving serious technical overkill. Suggestions?

So, what was it that I had planned to discuss this week? Oh yes, what e-commerce solution readers have recommended. We’ll have to leave that for next week.

Gibbs wrangles technology in Ventura, Calif. Join the roundup at gearhead@gibbs.com.