lit-xml
Version:
Burning your XML documents to the ground? Yes please. In the mean time, let's use lit-xml.
9 lines • 375 B
JavaScript
import { XMLValidator } from 'fast-xml-parser';
import { InvalidXmlError } from './invalid-xml-error.js';
export function isWellFormed(xml) {
const validationResult = XMLValidator.validate(xml);
if (validationResult !== true) {
throw new InvalidXmlError(validationResult.err.line, validationResult.err.msg, xml);
}
}
//# sourceMappingURL=validators.js.map