Module

x/xml/stringify.ts>stringify

πŸ“‘ A XML parser/stringifier for Deno written in typescript and with no dependencies
Go to Latest
function stringify
import { stringify } from "https://dotland.deno.dev/x/xml@4.0.0/stringify.ts";

XML stringifier

Convert a udocument into a string.

StringifierOptions can be used to customize the stringifier behavior.

Examples

Example 1

import { stringify } from "./stringify.ts"

console.log(stringify({
  root: {
    "#comment": "This is a comment",
    text: "hello",
    array: ["world", "monde", "δΈ–η•Œ", "🌏"],
    number: 42,
    boolean: true,
    complex: {
      "@attribute": "value",
      "#text": "content",
    },
  },
}))

Parameters

content: udocument
optional
options: StringifierOptions

Returns

string