Support is online

Combine XML Node Elements with the same name. #9062

Open j2UH8875Wvq4kbFS opened this topic Thursday, 03 August 2017 · 4 replies
Author

Hi
I originally post this in another thread but it's probably best that I create a new thread.

I have the following node elements in my xml file:

<property>
...
    <flags>
        <flag>Flag 1</flag>
        <flag>Flag 2</flag>
        <flag>Flag 3</flag>
        ...
    </flags>
    ...
...</property>

I need to combine all of the <flag> node elements into one flags field.

There can be any number of <flag> elements so I can't create a set number of "combine" fields. I also cannot edit the xml file as outlined at Process XML Files. How can I combine these elements into 1 field?
I have had a look at Import XML with same node names but this format doesn't seem to fit with my xml nodes.

Support

Hello,
CSVI will not be able to recognise the number of XML nodes you have in your import file , the number of combined fields you have in template fields will be taken and combined. One option is in the XML look for the maximum number of <flag> node elements and use so many of combine fields in combine rule.

Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

Hi Tharuna
Thank you for your message, I have done what you suggest but this only takes the first <flag> element and ignores the rest.
I have attached a couple of screenshots.

  • Screen Shot 2017-08-04 at 09.00.25.png
  • Screen Shot 2017-08-04 at 09.01.39.png
Author

Hi Tharuna, I have just tried importing again and it seems to work which is weird. :)

Support

Glad to know it works :)

Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Log in to reply to this topic.