How can i merge two XML strings

you see i have to merge two XML files together with App inventor

like this

<thing>
  <channel>wow channel</channel>
</thing>

merge with

<thing>
  <channel>cool channel</channel>
</thing>

to make

<thing>
  <channel>wow channel</channel>
  <channel>cool channel</channel>
</thing>

I would start by transforming the XML into a structure more amenable to manipulation, like a list of text from the inner core.

Append the two lists, then transform the result back into XML.

With Web component, there is a function which cna parse XML to List/Dictionary

This needed bespoke code.
The .aia includes some failed attempts based on pure text manipulation.
XML_stripper.aia (4.7 KB)

Here are successful blocks:






This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.