Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function parse(root: string, object: any, options?: IOptions): string {
const opts = new Options(options);
const document = new XmlDocument(
{
validation: opts.validation
}
);
if (opts.declaration.include) {
document.decl(opts.declaration);
}
if (opts.dtd.include) {
document.dtd(
{
// Validated in options.ts
name: opts.dtd.name!,
pubId: opts.dtd.pubId,
sysId: opts.dtd.sysId
}
);
it("#parseToExistingElement", () => {
const d = document();
d.procInst({target: "test4"});
const e = d.element({name: "test"});
parseToExistingElement(e, {"test2": "test3"}, simpleOptions);
assert.strictEqual(
d.toString({pretty: false}),
"test3");
});
});