See also:
Quaject
Articles
Topics
How-tos
XML

Parsing XML in JavaScript

Anton Vasetenkov
Web, data, bio, language.
XML
JavaScript

This is an example of parsing a string containing XML content:

const bookXml = `
    <book>
        <author>J. K. Rowling</author>
        <title>Harry Potter and the Philosopher's Stone</title>
    </book>
`;

const parser = new DOMParser()
const doc = parser.parseFromString(bookXml, 'application/xml')
See also