You are here:  » Multiple XML files for one store!

Support Forum



Multiple XML files for one store!

Submitted by Nick on Tue, 2006-08-29 11:33 in

Hi Guys!

Bit stuck, had a look around but cant seem to work out how to do this!

My one store insists on breaking up his product base over 10 files, i.e. 10 xml files.
Any idea how I can import them under one store?

Thanks....

Submitted by support on Tue, 2006-08-29 12:15

Hi Nick,

That's at tricky one with them being XML feeds. If this happens with CSV it's quite easy to merge the files in Excel or something like that before importing.

Can you perhaps email me 2 of the feeds (or if they're large drop me the URL to the feeds on your server, e.g. www.yoursite.com/feeds/foo.xml) and i'll have a look at the best way to go about it.

Cheers!
David.

Submitted by Nick on Tue, 2006-08-29 14:18

Awwww....

Fantastic, thanks so much for your time!

These are the feeds that are downloaded on a daily basis...

http://www.ebuyer.co.za/feeds/sybaritic1.xml
http://www.ebuyer.co.za/feeds/sybaritic2.xml
http://www.ebuyer.co.za/feeds/sybaritic3.xml

Any idea's as to a quick fix?

Submitted by support on Wed, 2006-08-30 14:18

Hi Nick,

What opperating system are you using? Do you have Telnet / SSH access to your server?

Cheers,
David.

Submitted by support on Wed, 2006-08-30 14:57

Hi Again,

Possible solution here - regardless of operating system. I've written a script to "merge" multiple XML files into a single file using the same tag hierarchy.

To use this script; firstly you need to run it from a directory that contains MagicParser.php (copy it from /includes), or simply change the include path. You also need to use the -q parameter when calling PHP so that it does not display the headers in the output. Finally, you need to redirect the output to a file instead of to the screen, which can be done with "> filename" on the end of the command line.

For example:

$php -q xmlcat.php sybaritic1.xml sybaritic2.xml sybaritic3.xml > sybariticAll.xml

Then, copy sybariticAll.xml into your /feeds directory and away you go (hopefully!) Source below...

Cheers,
David.

Submitted by Nick on Tue, 2007-03-20 15:37

Hey hey!

Been a while - hope you have been keeping well.

The above script was working perfectly the last few months on my dedicated host.

I have moved back to shared hosting, not everytime I run a PHP script it gives me a Segmentation Fault (core dumped) error. Rather annoying as I cant for the life of me get it right.

Any idea's? Or, is there a way I can call this from my browser.... on second thoughs i think I need to get it to work anyways because import.php needs it...um!

Do we need it for import.php aswell? Might be best to consult the host then!

Submitted by support on Tue, 2007-03-20 15:43

Hi Nick,

If this happens with any PHP script then I would definitely ask your host if they know of any problems running a script from the command line... This is quite a fundamental problem and would not point to a problem with the script at all but the setup. The host may already be aware of this so worth a try...

In the mean time, i'll have a search and see what conditions might cause PHP to generate a core dump...

Cheers,
David.