Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

458
Views
Create a XML DOM in OSB with JavaScript

JSON Requet
{"value":[{"bairro":"A Noite","codigoIBGE":3304144},{"bairro":"Albuquerque","codigoIBGE":3304144},{"bairro":"Aliança","codigoIBGE":3304144}]}

JavaScript action

var bairro = "<bairros>"; 
for( i = 0; i < process.body.value.length; i++ ){ 
  bairro += "<bairro>" + process.body.value[i].bairro + "</bairro>" 
}
process.bairros = bairro + "</bairros>"

How can i transform this XML string to an Object to replace my Response Body ?
On OSB 12c this code doesn't work.

parser = new DOMParser();
xmlDoc = parser.parseFromString(bairro, "text/xml");

Log: ReferenceError: "DOMParser" is not defined. (#6)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!