0

This question could have multiple types of answers, so I'll take anything you guys have to offer.

I have to transform an XML feed into a set of Pages (content-wise). Currently, I have a module I'm developing locally using PHP and SimpleXML in order to dynamically simulate these pages (so, each page being rendered is a completely dynamic thing controlled by the module).

I need to take this output and create a set of static pages on a production server. One painful thought I had was to render each page, copy the generated HTML, and physically create a new node. As there are a lot of pages being generated, this would be a long and drawn out process.

What would be nice is for some method to render all these pages in one go, and then somehow push them to my production Drupal installation.

A caveat, which would be more in the nice to have category is that it is possible for the XML feed to change. So, it'd be nice to, for instance, mark the changed text in a different color, or produce a new revision, or something along those lines.

I am using Drupal 6 (with no plans to upgrade).


I'll add an extra specific on this question. At present, I am using SimpleXML to walk through my feed, and using PHP to dynamically create an HTML tags I need. Essentially, I'm building up a string of HTML that gets returned from the module (in a _module_generate() function), which is then displayed by Drupal. If there is an easy way to take this, perhaps turn it into a Cron job, and have it produce some kind of output for the Feeds module (thanks @Clive), then that may be the easiest thing for me to do.

3
  • Have you come across the Feeds module? That plus the Diff module should get you most of the way there I think
    – Clive
    Commented Oct 31, 2012 at 16:22
  • I have, but the issue is that I have to do some pretty hefty transformations to the XML feed (hence the local PHP module)
    – erik
    Commented Oct 31, 2012 at 16:34
  • So @Clive, I read a bit more into Feeds and saw that it can easily import data from CSV and other formats. Is there an easy way to convert my dynamically created HTML pages (essentially just a string of HTML being returned from the module), to such a format for Feeds to read?
    – erik
    Commented Nov 3, 2012 at 19:04

1 Answer 1

0

Method I ended up using:

  • Procedurally create nodes on local environment, parsing XML feed with SimpleXML

  • Hardlink to production server when crosslinking nodes

  • Use Node Export to export/import nodes from local to production server

  • Use pathauto on production to create node aliases

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.