Skip to content

Documentation / @sw-file-lib/xml / XmlWriterOptions

Interface: XmlWriterOptions ​

ts
interface XmlWriterOptions {
  readonly indent?: string | number;
  readonly xmlDeclaration?: boolean;
}

Defined in: packages/xml/src/writer/index.ts:16

Options for configuring the behavior of an XmlWriter instance.

Properties ​

PropertyModifierTypeDescription

indent?

readonly

string | number

The string or number of spaces to use for indentation in the generated XML output.

If a string is provided, it will be used as the indentation for each level of nesting. If a number is provided, that many spaces will be used for each level of nesting. If undefined, the output code will not be indented and will be a single line.

Default

undefined

xmlDeclaration?

readonly

boolean

Whether to include the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) at the beginning of the output.

Default

true