How to use xmlcreate - 2 common examples

To help you get started, we’ve selected a few xmlcreate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github michaelkourlas / node-js2xmlparser / src / main.ts View on Github external
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
            }
        );
github michaelkourlas / node-js2xmlparser / test / src / main.ts View on Github external
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");
    });
});

xmlcreate

Simple XML builder for Node.js

Apache-2.0
Latest version published 2 years ago

Package Health Score

65 / 100
Full package analysis

Popular xmlcreate functions