Forums / Developer / Import XML Data Topic / Comment44913
*- pike
Sunday 19 November 2006 5:02:07 pm
Hi Maurizio
my xmlimport extension should be able to do this. it isn't published in the contributions yet; i'm waiting for a response from olivier pierret. it's tested with the 'objectrelationbrowse' datatype, but 'objectrelation' and 'objectrelationlist' should work, too.
take a close look at these screensnaps: http://pike.kw.nl/browse/files/projects/pike/2006/Exponential/XMLImport/screensnapsand notice the relations in the xmlfile.
as you see, relations are nested. inside the tag of the relationattribute, there are entries of the right datatype with a set of fields that should together form a unique identifier of the related resource. the importscript will perform a search on those. if it finds multiple applicable objects, it will return a warning and use the first one; if it doesn't find any applicable object, it will only issue a warning. see the output screensnaps for examples. ofcourse, the related object should have been imported before the relating object, it should already exist.
if you think you need this, contact me (pike-ez [AT] kw.nl)
*-pike
--------------- The class eZContentObjectTreeNode does.