I'm a newbie with Drupal, so please be gentle!

I have several XML files that get updated daily, weekly and monthly. I would like the content of these XML files posted in a table and displayed in a Drupal page. How would I do this? And, is there an automated method of updating the Drupal page when the XML file is updated - thru a cron job, etc.?

Thank you....

SysInfo:

Windows 2000 OS
IIS 5.x
Drupal 4.7.4
MySQL 4.x
PHP 4.4.4

Comments

alanburke’s picture

By co-incidence, I've just started to investgate this for a new project.

I reckon that the
import/export API module will certainly help to some degree
http://drupal.org/node/67043/

I need to achive something similar.

I need to be able to update the database, by uploading a spreadsheet.
I'm not sure how this could function.

I haven't seen a module that does exactly what i want, but I'll keep looking!

Regards
Alan

mlcc2000’s picture

I've downloaded the import/export module and started playing with it.

As I found out the hard way, be careful importing the examples. I imported the variable data example and changed many settings. Good thing I don't have many users - yet.

I'll let you know if I have any concrete success.

Thank you.

kiwibird’s picture

Was there any success with the import/export module?

This seems exactly like my problem too. There is an offsite XML (not RSS) file that I need to parse and cache every 10 minutes or so, storing it somehow in Drupal's database, and I'm guessing I'll write a viewer module for it too (not sure if the Views module will be enough).

(I'm guessing just making a cron job for some page that I define myself, I'm not sure if it's good practice to to call Drupal's own cron.php that often though? Do the modules that implement hook_cron() check to see if they've been called too recently?)

I need to figure out the best way of storing the content. If the import/export module does this all for me, that'd be great...

mlcc2000’s picture

No - import/export did not work for me. The limiting factor for me was the XML file. The only xml parser that would read it properly was a parser I wrote in perl. The parsers/modules in php/drupal would not read all the data. Yes, the XML file is probably non-standard. Oh well, I didn't create it - just gotta read it!

I put together something that seems to work for me. The xml content I deal with only updates once a day.

Setup a scheduled task (control panel on windows or cron on unix) that:
1. Copies my xml files from the various locations to my webserver.
2. Runs a parser to pull out the content I need and into a delimited file.
3. Create the tables and insert the content in the db .

To display the data:
Created "story" content which runs a small php script that presents the data in a table. Did not use the TableManager module - just html code.

Seems like a lot to go thru but it does work.

Does this help???

kiwibird’s picture

It is similar to what I'm planning on doing, although I've now written my parser as a Drupal module (using php's own xml parser), just putting the relevant info into a simple array before trying to make a my own CCK-node out of it. I'm not sure how to call it yet though, seeing as I only want this script to have access to creating that kind of node, but want the script called by cron (so cron needs to use a "logged in" web browser, I guess).

I'm still not sure how to programmatically create nodes though; I guess I could use your method to just bypass that, but I'd like to do things within the Drupal framework, since I want to use the Events module for nice calendar views.