Posted on 15/11/2007 17:13:25
Hi all,
I've been playing around for a bit now with the importing functionality of eCommerce, but I can't seem to get it right. So a little assistance would be nice ;-)
For testing purposes I have exported a file from the current eCommerce product database, and I have an XML file now that has the following structure:
PROD2
LANG1
SHOP1
Adidas Ajax uitshirt 2007 / 2008
PROD3
LANG1
Adidas sporttas
I have made an Import flow where the first block is a "XML file source" component with the following settings:
Root element = Root (what's this for anyway?)
XPath = //Product ( i want to have all products, could also have used /Products/Product )
Destination = /Filer/Integration/producten.xml
And the next block is "Product destination".
When I run this i get an error like:
4:28 PM Product destination Process Error: System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.LoadXml(String xml) at Dynamicweb.Integration.Specialized.ProductDestinationActivity.AddToQueue(XmlDocument xdoc) at Dynamicweb.Integration.Specialized.ProductDestinationActivity.Process()
4:28 PM Product destination Process Error: System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.LoadXml(String xml) at Dynamicweb.Integration.Specialized.ProductDestinationActivity.AddToQueue(XmlDocument xdoc) at Dynamicweb.Integration.Specialized.ProductDestinationActivity.Process()
Curious as I am, i replaced the "Product destination" box with a "Local file destination" box to see what data is constructed. Surprisingly, the configured "Root element" at the "XML file source" box is inserted in the XML structure as a parentnode of each (!) product.
So the xml looks like this:
PROD2
LANG1
SHOP1
Adidas Ajax uitshirt 2007 / 2008
PROD3
LANG1
Adidas sporttas
Is this normal behaviour? or am I missing something, and how would I go from here to get the products imported?
-Emil