Search

I know this problem has been mentioned a couple of times before but i believe this is slightly different.

I'm importing an external XML feed which contains data about travel deals. After a couple of errors (and solving them by Brendo's update) I finally got the XML importer extension working and successfully importing data.

I matched one field at a time and executed the importer after adding a new field every time so I would notice if (and when) something went wrong again and it did after like the fourth field.

I read somewhere that the Xpath Expression should be: fieldname/text() and untill now this worked perfectly fine. Then the error came back:

trim() expects parameter 1 to be string, array given

I figured out that the Xpath Expression: fieldname/text()[ 1 ] solved this and the data was properly imported.

Then the error came back again with a field that contained exactly the same sort of content (accomodation_type). However the text()[ 1 ] solution didn't work for this field.

Does anyone know what is happening here? Would really appreciate someone helping me out here!

Do you have any required fields in your section that are empty in the XML you are trying to import? I have encountered this on 2 local installs and it was due to empty strings being required and the validation not picking it up.

I did have some required fields but none of them were empty in the XML I was trying to import. However, I don't know why but after I removed all the fields in my section and added them again the error is gone and everything works like a charm! Thanks anyway.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details