I am currently in the process of a proof of concept migrating a existing site into Drupal 7. As of last week I have never seen Drupal, but so far very impressed, however I have one issue.

We have one XML document containing news items that gets updated numerous times per day, I need to create new documents from this. I have seen snippets of php code that load the XML and create nodes, I will need to create our own custom code to do this- however I am not sure exactly where this code would go or how you run it in a Drupal context?



Drupal has a Feeds module that may already have some of the functionalities you're looking for. Check it out and it may save you some coding.

If you decide to write your own, then you would have to write your own module. Module development example can be found at http://drupal.org/node/1074360

  • Thanks for the reply nmc. I did install the Feeds module, but that wasn't appropriate - I'll check out the module development section, I can't see it yet, but I am hoping it has some kind of job scheduler.. – diesel Jul 20 '11 at 12:42
  • I've never done it but i know there's a hook_cron_queue_info() method and also there is a Job Scheduler module. – nmc Jul 20 '11 at 12:51
  • @diesel: Feeds works great to import content periodically from XML files. But you probably need an additional parsers plugin to load your XML file. Likely Feeds XPath Parser (drupal.org/project/feeds_xpathparser) but there is others, see drupal.org/node/856644. You may also need to write your own parser too if your XML is too large to fit in memory or need special handling. – Pierre Buyle Dec 1 '11 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy