Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | 106x 106x 330x 106x 224x 106x | import type { Document as XmlDocument } from '@xmldom/xmldom';
import { isXmlDeclarationNode, serializeXmlNode } from './xmlSerializationHelpers';
export function serializeXmlDocument(document: XmlDocument): string {
let xml = '<?xml version="1.0" encoding="UTF-8"?>\n';
for (const child of Array.from(document.childNodes)) {
if (isXmlDeclarationNode(child)) {
continue;
}
xml += serializeXmlNode(child, 0);
}
return xml;
} |