Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Great module! I can successfully import XML and create nodes via the import. Is it possible to import to multiple content types? I see that you can only process to one node type by default. In my XML file I have data that needs to be mapped into 2 node types.
Is this possible? Any suggestions?
Comments
Comment #1
ambientdrup CreditAttribution: ambientdrup commentedI located another module that does this: xml2node: http://drupal.org/project/xml2node.
I'm going to try structuring my XML document similar to how xml2node requires it to be structured in order to import to multiple types (from same XML file); and then try running another import using Feeds XPath.
xml2node also supports node reference fields.
Comment #2
twistor CreditAttribution: twistor commentedThe easiest way would be to set up multiple importers one attached to each content type. This module doesn't handle the mapping. You could use this to map to users or taxonomy terms if you wanted. You might want to post a question on feeds but that seems like a pretty big architectural change.
Comment #3
Problue SolutionsSubscribe
Comment #4
twistor CreditAttribution: twistor commentedAnyone want to give this a try? http://drupal.org/sandbox/twistor/1135898
Comment #5
eneko1907 CreditAttribution: eneko1907 commentedInteresting functionality request indeed.
Sometimes content is encapsulated in XML, in the process content is de-normalized. Consumers of such XML files want to normalize the content again. Example:
You can envision having a content type for authors, and a content type for songs.
Yet, both need to be related (a song has authors, and viceversa).
author CCT (name, and node_reference fields)
song CCT (title, and node referrer (or other node reference))
@ambientdrup points to the xml2node module, which in itself is interesting, but for this use, one would have to transform the XML to make it conform to the drupal-template schema that xml2node understands. It seems that I would have to extend the module to understand other XML schemas.
@twistor points to a sandbox module that may be super cool, unfortunately, only would work in a D7 instance, and Im not yet there.
There are other interesting things -- along with the Feeds Xpath Parser, there is the "Mapper for Node reference" patch (see http://drupal.org/node/724536). This may get us closer to the functionality, as it creates the relations to other content types. But still, one would like something like having the cck_fields of the referenced content type available in the select list within the mapping settings.
In sort, instead of mapping content to 1->n type of fields in the same content type, we mapr but these 1-> many XML fields are in other content type.
The problem is well stated by @ambientdrup, but I would go a step further and request that the inherent relationship in the XML is preserved using node reference fields. It would be a way to reconstruct fully relational databases that are de-normalized when exposed through web services, or ported using complex XML schemas, etc.
Great module, thanks a lot.
Inigo
Comment #6
twistor CreditAttribution: twistor commentedThere is now a 6.x version of the multi-node processor if you're interested.
Comment #7
eneko1907 CreditAttribution: eneko1907 commented@twistor,
Yes Im v. interested -- I think you are referring to your sandbox project, i just checked out (cloned) your project, but the .info specifies the Feeds Multi-node Processor is for core = 7.x. I looked a bit under your projects, but couldnt find the 6.x branch. Im assuming you are not referring to the Multi-source processor, etc.
Thank you very much,
inigo
Comment #8
hawkeye.twolfAlso see: Feeds Node Helper.