1. jaak69
  2. RO CSVI
  3. Saturday, 06 May 2017
  4.  Subscribe via email
Hello,

I get my product data through webservice (odata webservice). The script has been written to get data and write the data to the XML file. Mostly everything works but in some occasions I run into trouble.

I don't have influence how the data has been written: product name or description or something else.

xml looks:

<product>
.....
<Name>product name</Name>
......
<Parameters>
SAMPLE content in attached file
</Parameters>
</product>

Now I have run into two problems and one question:

  1. Malformed XML - In one occasion in long product name is used character "&" which will broke the XML file

  2. Duplicate slugs - two product have same name (the first 64 characters) and the slug generated is same too.

  3. Has CSVI Improved ability to process XML tag (<Parameters>;) which has variable number of property subtag groups and these groups are not ordered.



In both situations import of products stop then error have occured. Does CSVI Improved have functionalty to skip product import witch have caused error and proceed with import not halting it. Or is there another option to solve this?

Jaak
Accepted Answer Pending Moderation
Hello Jaak,

Malformed XML - In one occasion in long product name is used character "&" which will broke the XML file
Having the & symbol without CDATA tags around it is invalid. They are not following the XML specifications. This should be taken up with the party creating the XML file. We can't deal with files not following the specifications.

Duplicate slugs - two product have same name (the first 64 characters) and the slug generated is same too.
We can have a look at that to see if we can improve the slug creation when the names are that long and still the same. Do you have an example XML where this is the case?

Has CSVI Improved ability to process XML tag (<Parameters>;) which has variable number of property subtag groups and these groups are not ordered.
This is why I am not a fan of XML files :P The only thing you can do here is add all the possible parameters into your template. Let's say you have a node called Parameters/Old and the maximum number of times this can occur is 10, you will need to add this field 10 times to your template. CSVI will fill it up like a stack, so the first time it finds it, it goes into the first Parameters/Old, the second time it finds it, it goes into the second Parameters/Old and so on.

You don't specify which error you see, if they are not fatal errors, you can set the Error Reporting to None in the Joomla Global Configuration and the import might continue because the error is not output and thus not breaking the import.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hello,

Duplicate slugs problem:
I add example file how it's look like.

Both of the described errors ("&" in text and products which have in name common 64 first characters) have caused fatal error and the process of import has been terminated.

Is it possible following:

  • If CSVI Pro will find inside one <Product> tag something that isn't appropriate for XML can CSVI Pro will be made behave to ignore information from that one tag and move on to next one. Not to terminate import process.

  • For duplicate slug problem. If CSVI Pro during import process find duplicate slug can it for example add "-1" or "-2" if more products with same slug exists at the end of generated slug like Joomla itself behaving then copying for example menu entry.



<Parameters> tag problem:
Following your description it seems that more easier to preprocess information from this tag in downloading script and add only final result into XML file

Jaak
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Jaak,
If CSVI Pro will find inside one <Product> tag something that isn't appropriate for XML can CSVI Pro will be made behave to ignore information from that one tag and move on to next one. Not to terminate import process.

There is no such way to check a node and continue on import process but if there are any specific scenarios you know where the import fails you can try to do some custom coding to avoid these errors by creating override file for import and so import continues.

For duplicate slug problem. If CSVI Pro during import process find duplicate slug can it for example add "-1" or "-2" if more products with same slug exists at the end of generated slug like Joomla itself behaving then copying for example menu entry.

For duplicate slug problem, in your import template settings on Options tab, you can set Recreate alias to Yes. This way CSVI will add digits "-1" and "-2" when there is already a product with same slug. Try and see if it helps.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hello Jaak,

Just another note on the incorrect XML file, I don't think it is CSVI that terminated the import but PHP as it can't read the file. However without the exact error message it is hard to tell what is going on.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!