RE: Help: XML Feed From Vendor

Yrcimim <[email protected]>
Newsgroups gmane.comp.web.oscommerce.features
Message-ID <d870eb92ba46a19378bdf2ca6808c4cf@osCommerce-Forums>
This message was sent from: Features
http://forums.oscommerce.com/viewtopic.php?p=207190#207190
----------------------------------------------------------------

I wrote a tiny program that converts CSV format (ASCII) from (in my case) Excel into
XML. I've done this on 2 seperate occasions: once for a customer who received a
pricelist with 20000+ articles, once for myself.

The customer I mentioned used some administration program that could only
import a product pricelist in a strict predefined XML format. CSV to XML is a
breeze: 20000+ articles were converted in a few seconds (didn't time, less than 10
secs on a Celeron 600 PC...). The administration program took about 90 minutes
to crunch that XML file.

I receive weekly (sometimes daily) pricelist updates from my vendors. I still have
to convert them to CSV by hand, as these Excel files are cluttered with advertising
stuff, but after that it's simple to convert to XML. Once I can import it to MySQL,
the database can do all things regarding my own price updates and notify me on
products that went obsolete or came in a fresh. As soon as I have things working
on the XML to MySQL part, I have a legitimate reason to ask my vendors to
deliver in CSV right away. They only have do is leave the advertising stuff out...

Concerning your problem: it all starts by defining all input/output relations. Developing
an ASCII to XML translator is simple and should take no more than a few hours. The
problem lies in pinpointing the relations between the way that inputdata uses XML to
travel to the database and the way the database uses the data. Eg. if you use a
fixed margin on the major part of your products and some other margins on a few
(groups of) other products, where do you put your calculations to establish the selling
price ? You can do it right upfront in the conversion to XML, so the database can use
the difference between cost and sell to establish margins. You can do it in the database,
based on the type of data you're importing. You have to take all of these things into
account. It gets more complex for every additional datafield that your inputdata
contains. There's no easy solution. There are probably tools that can help building
it.

I just found PHP Classes (I programmed a lot in the past, but am new to PHP) and
discovered XMLFile and "MySQL to XML - XML to MySQL". I'll dive into that to see
if it can bring me the solution...

-Martijn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.