This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function xmlToJson(xml) { | |
| const parser = new DOMParser(); | |
| const xmlDoc = parser.parseFromString(xml, "text/xml"); | |
| const rootElement = xmlDoc.documentElement; | |
| function parse(node) { | |
| switch (node.nodeType) { | |
| case Node.ELEMENT_NODE: | |
| // Convert attributes to object | |
| const attributes = {}; |