1

Is it possible to import XML and create a node upon request?

For example, if a user clicks a link http://www.site.com/item-1, can the corresponding XML file http://www.othersite.com/path/to/item-1/doc.xml be imported as a node at that time, and the user redirected to the new node?

(The XML file is massive, with about 200 fields I need to bring in.)

1 Answer 1

1

The short answer is: "yes, it is possible".

There may be different ways of approaching this, but one approach is to use some sort of URL rewriting (e.g. Apache RewriteRule) to let Drupal pick up the external xml file, and then have a custom module that picks up and parses the XML and programatically creates a node with this data stuffed into the appropriate fields and redirects the user to this node.

I've written a custom module for a client that does exactly what I describe above.

1
  • I'm using Migrate to import other XML data in a list. I figured I could also use Migrate to do these on demand, but I'm not quite sure if it will work, and the client doesn't have any data I can test with.
    – user13620
    Commented Feb 12, 2013 at 8:37

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.