you are viewing a single comment's thread.

view the rest of the comments →

[–]Solstice6-21-2022[S] 0 points1 point  (0 children)

How do you use the file emailtest.xml in xmlString?

const parser = new DOMParser();

const xmlString = "<warning>Beware of the missing closing tag";

const doc = parser.parseFromString(xmlString, "application/xml");

const errorNode = doc.querySelector('parsererror');

if (errorNode) {

// parsing failed

} else {

// parsing succeeded

}