How do I add this detail to the XML?


I have this structure in the XML at the top:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 

I need to get this:

<?xml version="1.0" encoding="UTF-8"?>
<Ads formatVersion="3" target="">

i.e., I need to

  1. remove: " standalone=“yes”? " and
  2. add " formatVersion=“3” target=“” " in Ads

Please help me. How to do it?

Thank you very much!

Please share the workflow

Information on your n8n setup

  • n8n version: 0.213.0
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm,, desktop app]: Docker

There is this option:

or add a Code node to your XML node with the following code:

var data = $input.all()[0]

var data = data.replace(' standalone=“yes”? ', '')
var data = data.replace('<Ads>','<Ads formatVersion="3" target="">')

return {"data": data}

HI @dickhoning !

Thank you so much for your time and help! :+1: :handshake:

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