[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

jquery/javascript Replacing and adding quotes to xml

Working  with the attached file, trying to make the xml have the following changes:
1.  "  change to ""
2.  beginning of each xml node has quote added to it
3.  ending of each closing xml node has " & _     added to it

I have #1 working.  
Help with #2 and #2 appreciated
0
KeithMcElroy
Asked:
KeithMcElroy
1 Solution
 
cmalakarCommented:
Test with this.

<!DOCTYPE html>
<html>
<script>
var x = '<abc><xyz></xyz></abc>';
x = x.replace(/(<[^/][^>]+>)/g, '"$1');
x = x.replace(/(<[/][^>]+>)/g, '$1"_');
alert(x);
</script>
<body>
The content of the body element is displayed in your browser.
</body>
</html>

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now